Rob Camick wrote:Not sure what your real requirement is so I con only make a couple of comments:
1. Components should be added to the frame BEFORE the frame is make visible.
2. You should use frame.pack() just before frame.setVisible() and components will be displayed at their preferred sizes.
If a horizontal scrollbar is needed there is the same problem. A vertical scrollbar is shown.3. To display a table in a scroll pane without scrollbars you can use:
before you add the table to the scrollpane.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
If a horizontal scrollbar is needed there is the same problem. A vertical scrollbar is shown.
Rob Camick wrote:
If a horizontal scrollbar is needed there is the same problem. A vertical scrollbar is shown.
Well you can modify the logic to control the width:
No need for the code to calculate the size of the scrollpane.
Or another option might be to have the horizontal scrollbar always displayed. It will be greyed out if it is not needed. Read the JScrollPane API for the constructor or method to set this property.
Don't get me started about those stupid light bulbs. |