Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridBag Layout Problem

 
Nigel Browne
Ranch Hand
Pie
Posts: 682
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently creating an application that uses nested layouts to create a complex input form. So far everyting has functioned as expected until now. I post an image of what is occuring
and here is the excerpt of code producing the strange behaviour


I hope you understand my query. I can post more code or screenshot if necessary.

regards
Nigel
 
Steven Bell
Ranch Hand
Posts: 1071
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure why it's not working for you, not a GridbagLayout guru. I might suggest trying JGoodies forms if you can. You can download the library here. It took less time for me on one project to change everything to the JGoodies forms than it would have taken me to fix the GBL problems I was having, and I ended up happier with the GUI when I was done.
 
Nigel Browne
Ranch Hand
Pie
Posts: 682
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To clarify further the setGbc method has the following argument list
 
Nigel Browne
Ranch Hand
Pie
Posts: 682
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved it I forgot to add the GridBagConstraints when added the panel.
:roll:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic