aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Gathering input data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Gathering input data" Watch "Gathering input data" New topic
Author

Gathering input data

Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

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?


SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
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

Joined: Jul 26, 2007
Posts: 10376
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Gathering input data