This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Optimal solution for creating multiple dialog's with different fields?

 
Kristjan Toots
Ranch Hand
Posts: 59
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello fellow Ranchers.
I'm working on a personal project where I'm trying to create simple swing/database application. I am certainly not professional developer and I do not even consider myself as a moderate at this point of time. Therefore I turn to community to ask how should I approach this kind of problem.

I imagine alot of dialog boxes jumping around to fetch user input. Would need to present labels, textfields, passwordfields, combobxes, checkboxes etc in various dialog windows.
For example: creating the database firsthand, creating the first admin account, adding users, changing user accounts etc.



Can I somehow use OptionPane to present all those dialog's?
I suppose that creating separate classes which extends JDialog for every dialog I need wouldn't be optimal?

I'm not looking for full solution but rather I would like to know where to look for. Or how should I think about this problem.

Thank you.
 
Rob Camick
Ranch Hand
Posts: 2612
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I somehow use OptionPane to present all those dialog's?


You can add any component to a JOptionPane. So you can create a JPanel with your components and then display the option pane using the panel.

 
Kristjan Toots
Ranch Hand
Posts: 59
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Rob Camick, your responses are always useful.

I have an understanding that JOptionPane is used to create simple quick & easy modal dialog's. I would really like to know why one would choose one over another in this case. Which one is more preferable to use: JOptionPane vs. JDialog

I am asking this because I would like to know how one should do this correctly.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic