It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes Gui problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Gui problem" Watch "Gui problem" New topic

Gui problem

gaurav manchanda

Joined: Dec 29, 2006
Posts: 1
I am new one to this forum.
I am facing the problem with swing components.
I am having the tabbedpane on which i have added the panel with gridbaglayout.In the panel I have different kind of swing components like JTable,JTextField,JTextArea etc.
when i put the huge value in the textField or cells of table and when i click on remaining part of tabbedpane on which my panel is not there.
the TextField and the cells used to get expand horizontally to show the whole value entered.
how to avoid this?
Thanks in advance
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
GridBagLayout is very respectful of and attentive to the preferred sizes of its child components. Try setting the number of columns for the JTextField and setting a preferredSize or a preferredScrollableViewportSize for the JTable.
Unnar Björnsson
Ranch Hand

Joined: Apr 30, 2005
Posts: 164
Layout managers have always given me headaches, my advice is don�t use layout managers
Brian Cole
Ranch Hand

Joined: Sep 20, 2005
Posts: 878
Originally posted by Unnar Bj�rnsson:
my advice is don�t use layout managers

Well I strongly disagree with Mr. Bj�rnsson on this point. It might be good advice to avoid GridBagLayout, though.

bitguru blog
I agree. Here's the link:
subject: Gui problem
jQuery in Action, 3rd edition