• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Gridbag layout problem, element comming in center

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to add child JPanel dynamically in parent JPanel using grid layout in JFrame.

When ever i add componenet, it comes in the center only.Then i set the weighty=1. Now first compoenet is comming on top, rest all are added at the bottom.

One more thing, All the child elmenet should be of same size, and it should not cover the entire remaining area. How can i set a constraints, so that each child panel are added one after the other from top to bottom?Please help. It is really urgent.

Thanks in advance !
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Weightx and weighty are the attributes used with the GridBagLayout. You mentioned GridLayout. Which one are you really using.

You might find this useful
http://www.horstmann.com/articles/Taming_the_GridBagLayout.html

Also google for MigLayout. You might want to consider it in place of GridBagLayout
 
ujjval pandya
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Weightx and weighty are the attributes used with the GridBagLayout. You mentioned GridLayout. Which one are you really using.

You might find this useful
http://www.horstmann.com/articles/Taming_the_GridBagLayout.html

Also google for MigLayout. You might want to consider it in place of GridBagLayout



Opps, Its only GRID BAG LAYOUT only!!!
my mistake.sorry.

 
ujjval pandya
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Weightx and weighty are the attributes used with the GridBagLayout. You mentioned GridLayout. Which one are you really using.

You might find this useful
http://www.horstmann.com/articles/Taming_the_GridBagLayout.html

Also google for MigLayout. You might want to consider it in place of GridBagLayout



Is it not possible with grid bag layout? The link you gave is not useful in this case.
Any other help ...

its urgent...
thanks in adavance ,..
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Relax! All of us are volunteers here and nobody really gets paid !
http://faq.javaranch.com/java/EaseUp
http://faq.javaranch.com/java/PatienceIsAVirtue

You have not posted your code and you think the link is not useful. Very difficult for us to figure out the problem on that input isn't it?

Why don't you post your sscce code so we can take a look?
 
reply
    Bookmark Topic Watch Topic
  • New Topic