• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Gathering input data

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I would like to write a kind of GUI using SWING.
I want to gather some input data from user. I have to use a couple of frames to gather this information.
What's the best practice to do this?

What about this:
1). frame1.isVisible(true);
2). user provides data and then clicks next "button"
frame1.isVisible(false);
frame2.isVisible(true);
//next and next

Is it a good solution?
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do most programs you use gather this information? Try to emulate those programs. Most don't have frames swapping with each other. Some have swapping panels (think CardLayout). Some use tabbed panels (think JTabbedPane), some use modal dialogs (think JOptionPane or JDialog).
 
Maneesh Godbole
Saloon Keeper
Posts: 11073
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I personally feel JTabbedPane is not an intuitive component to gather multiple input from the user. YMMV.
Card layouts will help you with Wizard king of UI.
JOptionPane has built in showInputDialog which can be heavily customized. I would prefer it over JDialog as it saves me the hassle of creating and controlling the dialog.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic