• 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

JDialog + Design questions

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic