O'Reilly logo

JavaFX 2.0: Introduction by Example by Carl Dea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1-17. Developing a Dialog Box

Problem

You want to create an application that simulates a change password dialog box.

Solution

Use JavaFX’s stage (javafx.stage.Stage) and scene (javafx.scene.Scene) APIs to create a dialog box.

The following source code listing is an application that simulates a change password dialog box. The application contains menu options to pop up the dialog box. In addition to the menu options, the user will have the ability to set the dialog box’s modal state (modality).

/**  * Developing A Dialog  * @author cdea  */ public class DevelopingADialog extends Application {     static Stage LOGIN_DIALOG;     static int dx = 1;     static int dy = 1;     /**      * @param args the command line arguments      */     public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required