users
[Top] [All Lists]

Re: [cinjug-users] Swing Pop Up Window

To: "Jackson, Doug" <DOUG.JACKSON@xxxxxxxx>
Subject: Re: [cinjug-users] Swing Pop Up Window
From: Eric Galluzzo <egalluzzo@xxxxxxxxxxxxxxx>
Date: Fri, 23 Apr 2004 13:08:01 -0400
Cc: "'users@xxxxxxxxxx'" <users@xxxxxxxxxx>
Delivered-to: mailing list users@cinjug.org
In-reply-to: <0A5C43B71EC8EE4F8393BCADE546841A021B7FC0@vie-its-exs02.mail.saic.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <0A5C43B71EC8EE4F8393BCADE546841A021B7FC0@vie-its-exs02.mail.saic.com>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040421
Jackson, Doug wrote:

Does anyone know how to make a separate JPanel or Window and call it from an
application.
I need to make a separate pop-up window with info while keeping the original
screen it was
called from the same.  I need to do this in swing.  Can anybody help?

Thanks in advance.


I'm not sure I quite understand your question, but if you need one of the "standard" modal dialogs, you can use the static methods on JOptionPane. If you need a more complex modal dialog, a non-modal dialog or just a completely separate non-dialog type window, you can construct a JDialog or JFrame as follows:

JFrame frame = new JFrame( "Title here" );
frame.getContentPane().setLayout( ... );
frame.getContentPane().add( ... );
frame.setVisible( true );

A JDialog is much the same as a JFrame except that it can be modal, and it doesn't show up in the list of windows (e.g. in your Windows taskbar or [I think] GNOME panel). It's considered kind of a sub-window, whereas a JFrame is a proper top-level window. In order to get rid of a dialog, especially a modal one, call the dispose() method.

Hope this is what you were looking for!

   - Eric


<Prev in Thread] Current Thread [Next in Thread>