How to make JScrollPane fit to my jTable?

徘徊边缘 提交于 2019-12-11 05:41:28

问题


I have a problem with JScrollPane when it is used with JTable. How can I make it such that the the scrollPane doesn't have a blank space below the JTable as can be seen in the picture

Also,I am currently using a JTabPane that contains 2 JPanels, one for the JScrollPane and one for the JList at the bottom. Is this the right way to do things?


回答1:


The method setPreferredScrollableViewportSize(), mentioned here, may be useful in this context.



来源:https://stackoverflow.com/questions/10809263/how-to-make-jscrollpane-fit-to-my-jtable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!