Shrink JScroll Pane to same Height as JTable

后端 未结 5 1526
独厮守ぢ
独厮守ぢ 2020-12-16 12:07

I currently have JTables nested in JScrollPanes like so:

\"enter

My problem is

5条回答
  •  难免孤独
    2020-12-16 12:58

    If you use MigLayout, when add the scrollpane containing the JTable, you can specify the constraint growx instead of grow, to make it stretch only horizontally.

    Now the scrollpane is located in the middle of its parent. You can set in the row constraint to make it align to top of the row. Or, in component constraint: aligny top.

提交回复
热议问题