aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Input  Display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Input  Display" Watch "Input  Display" New topic
Author

Input Display

jonas okwara
Ranch Hand

Joined: Jun 22, 2004
Posts: 58
I don't want to use the JOptionPane.showInputDiag method to input a username. How else can I do this from within my main class ? I have tried inner class without any success

thx

jonas
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

How else do you want to do this? Is this a GUI application? Would you prefer getting the username from the console? Can you be more specific with your question?


GenRocket - Experts at Building Test Data
jonas okwara
Ranch Hand

Joined: Jun 22, 2004
Posts: 58
To be explicit, I am doing a GUI application with a "start" button among others. Once the "start" button is clicked, another gui jumps out and asks for a username and subject. I have done this with a JOptionPane method but wish I could be more expressive with another frame. however this has proved to be difficult.


thanks

newbie
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

The easiest thing to do is create a JDialog. It's basically a JFrame that can be modal (when it's open, the other application frames are inaccessable). You can add any component to it that you want, just like a JFrame.

Take a look at the Dialog tutorial on Sun's Swing Tutorial. It will show you how to use the JDialog class.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Here's something to play around with (it's rough)

jonas okwara
Ranch Hand

Joined: Jun 22, 2004
Posts: 58
Remember to be nice to people on your way up for you might meet them on your way down

Thx

Folks
 
 
subject: Input Display