File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Gui problem

 
gaurav manchanda
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
gaurav
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 164
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Layout managers have always given me headaches, my advice is don�t use layout managers
 
Brian Cole
Author
Ranch Hand
Posts: 886
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic