• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog + Design questions  RSS feed

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body, I have two questions please:
1. if I had a JPanel and this panel contains labels, textfields, comboboxes, checkboxes....
which layout manager should I use in this case: GridBagLayout or null layout?
2. I have a button, when clicked, it must shows a custom dialog (this dialog will contains textfields and radiobuttons, and the user must fill these fields).
when the use fills this fields, how to return this data(lets say, for display pupose)?
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personnaly I would never use the null layout. Not knowing exactly how your gui is supposed to look I can't just say use GribBagLayout. It should be able to do what you want but there are other possibilities based on what is needed.
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given the choices, I'd say:
1. Never use null layout
2. Why not go with GridBagLayout - it will give you everything you need in terms of a custom layout.
As far as returning the data, Create a constructor in your custom JDialog in which you pass a reference to the parent. Then when the use is done filling out the JDialog the JDialog can call the method that you want to perform to update the GUI, lets just say the method is called updateScreen(). Then, you would do parent.updateScreen()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!