Skip to main content

How to invoke a child window

2 replies [Last post]
tanww888
Offline
Joined: 2007-07-25

Hi,

I'm new to javafx. I've searched the web for information on how to invoke a child window from a parent or menu, but found no hit. I want to create a menu item that will popup a form window (child). I did found some examples on using a dialog to create a form window, but no sure if this is how javafx handle a popup window. Please advice and thank for any help!

Regards,

Johnny

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pforhan
Offline
Joined: 2003-08-07

It sounds like you may be new to Swing programming, too. I'd suggest following the Java Tutorial on the Swing trail before even trying to mix in JavaFX -- the underlying components are the same.

In a nutshell, depending on your needs, you will likely use the JOptionPane.showXX methods for simple input, or create a JDialog to house your custom components. Either of these would be shown in the actionPerformed() that is called in response to selecting a menu item or button.

I just added this page to the jfx wiki:
http://jfx.wikia.com/wiki/Using_built-in_Dialogs

And this appears to be a more interesting usage:
http://jfx.wikia.com/wiki/Dynamic_Menu_and_Alert_Box

Pat.

tanww888
Offline
Joined: 2007-07-25

Thanks! That's what I'm looking for.

Regards,

Johnny