JavaFXApplet
This tutorial shows how you configure a draggable JavaFX Applet. A draggable applet can be dragged out of the web browser, and it keeps running even after the browser is closed. When you quit the Applet, you can reopen it via a shortcut from the Windows explorer like any other desktop application.
Pre-requisities
Make sure Firefox or IE7 is your default browser and it uses the JRE 6u10!
For the Store as Shortcut feature, go to Control Panel of your Java Control Panel -> Advanced tab -> Shortcut Creations and set the radio button to prompt user (or something similar).
Create a simple JavaFX application
- Start NetBeans 6.1 with JavaFX
- Go to File | New Project | JavaFX | JavaFX Script Application, Next, Finish
- A new JavaFX project is created and Main.fx is opened
- Drag and drop the item Applications | Application from the palette to the editor
- Drag and drop the item Text from the Palette to the content of the application in the editor
- Open project properties by right-clicking on the project in the Projects window.
- Go to the Applet category and check:
- Run Applet in browser
- use JavaScript
- from jnlp file
- draggable
- Confirm by clicking OK
- Right click on the Main.fx in the Project window.
- Click 'Run Applet' from the context menu
- The Applet will start in the browser.
- Press and hold Alt key and drag the applet out of the browser window.
- Close the browser and it will ask you to store the applet as a shortcut.
- Note how the Applet keeps running even after the browser is closed.
Kaynak wiki.netbeans.org/JavaFXApplet
Yorumunuzu Ekleyin