• 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
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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.
 
You have to be odd to be #1 - Seuss. An odd little ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic