Multiple JFrame

K

kandy71

Hi,
I try to develop my first graphical interface with java.
Since I need to use an application with different input windows, I need
to open these windows deciding with a menu when I need them. I would
like to know if my approach is corret.
I open for every windows a new jframe, however, I believe the it is not
the right way since all the frame are not connected and the do not
depend from the main frame.
Any suggestion?
 
I

IchBin

Hi,
I try to develop my first graphical interface with java.
Since I need to use an application with different input windows, I need
to open these windows deciding with a menu when I need them. I would
like to know if my approach is corret.
I open for every windows a new jframe, however, I believe the it is not
the right way since all the frame are not connected and the do not
depend from the main frame.
Any suggestion?

You want to have one JFrame and then you can open JDialogs from the
JFrame making them model. When you display a JDialog the first parameter
is the reference to the Calling JFrame.

Look at the JDialog api. You may even be able to use JOptionPane.

Article on JDialogs:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Dialog API:
http://ozark.hendrix.edu/linux/docs/java-5-api/java/awt/Dialog.html
JOptionPane API:
http://ozark.hendrix.edu/linux/docs/java-5-api/javax/swing/JOptionPane.html




--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
A

Andrew Thompson

IchBin said:
(e-mail address removed) wrote: ... .....
You want to have one JFrame and then you can open JDialogs from the
JFrame making them model.

Right concept, but a typo., that should be 'modal'.

The OP might also look into JOptionPane.showInputDialog()

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top