| Author |
swing problem
|
rish obe
Greenhorn
Joined: Jun 19, 2007
Posts: 6
|
|
I am taking inputs from a xml file and setting the node names as "labels" and the data as "textfields" . depending on the humber of nodes in the xml file, labels are created along with textfields and are displayed in a panel with labels on left side and textfields on eight side . , as in , a 2 columns and n rows depending on nodes. Now , the problem i am facing is that , depending on the number of textfields , they are resized ... if less in number , textfields are larger in size and if more in number the textfields size shrinks They are tied to the frame and cover up all the empty space. i m using gridlayout. wat shud i do to avoid this. i have tried using textfield.setPreferred(new Dimension(3,3)) but does'nt work.
|
 |
Brian Cole
Author
Ranch Hand
Joined: Sep 20, 2005
Posts: 852
|
|
Originally posted by rish obe: Now , the problem i am facing is that , depending on the number of textfields , they are resized ... if less in number , textfields are larger in size and if more in number the textfields size shrinks They are tied to the frame and cover up all the empty space. i m using gridlayout.
Well that's how GridLayout works. What you probably want to do is add your labels and text fields to a separate panel (using GridLayout), then put that panel into NORTH of a BorderLayout.
|
bitguru blog
|
 |
 |
|
|
subject: swing problem
|
|
|