• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

swing problem

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Author
Posts: 974
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!