• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable problem, please look into this

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I'm using a JScrollPane to show the JTable.
The overall layout for the Frame is BorderLayout.
I have put the scroll pane in the center of BorderLayout.
Now when i start the application and populate the JTable, all the columns occupy the entire width of the frame.Population happens at a click of a button.
BUT,
if i maximize the frame and then populate then the columns do not expand to occupy the entire width of the frame.Looking forward to a solution from someone.
thanks in advance
karthik.
 
Toshifumi Ishii
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
done frame.pack() before frame.show()?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karthik,
I am not exactly sure why you are having problems. If I understand what you are doing then the maximize action should stretch the table to still fill the entire BorderLayout center. Does the table then resize itself after being filled? If that is the case then you have set to many table attributes ... The code below doesn't have any problem, check it out.

Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!