JavaFXPluginTutorial

(Difference between revisions)
Line 3: Line 3:
==Install NetBeans 6.8 Beta and JavaFX plugin==
==Install NetBeans 6.8 Beta and JavaFX plugin==
-
# Go to the [http://download.netbeans.org/netbeans/6.8/beta NB Download page]
+
# Go to the [http://download.netbeans.org/netbeans/6.8/beta NetBeans Download page]
<span style="color: 'red'">Spell out NetBeans. Correct Link to full version when available.</span>
<span style="color: 'red'">Spell out NetBeans. Correct Link to full version when available.</span>
# Download the NetBeans with the JavaFX bundle
# Download the NetBeans with the JavaFX bundle

Revision as of 14:12, 25 November 2009

Contents


Install NetBeans 6.8 Beta and JavaFX plugin

  1. Go to the NetBeans Download page

Spell out NetBeans. Correct Link to full version when available.

  1. Download the NetBeans with the JavaFX bundle

Change to indicate "Download and Install of one of

    1. NetBeans 6.8 with the JavaFX Bundle
    2. NetBeans 6.8 Full installation
    3. NetBeans 6.8 (any version) and add the JavaFX Plugins from the Tools->Plugins->Available Plugins dialog.
  1. Launch the installer

Remove

Create a simple JavaFX Application

  1. Run the IDE

Change "Run" to "Launch" or "Start"

  1. Invoke Tools | New Project... from the main menu bar.

Change "Tools" to "File"

  1. Under Categories, select JavaFX.
  2. Under Projects, select JavaFX Script Application.
  3. Click Next.
  4. In the Project Name field, type HelloWorld.
  5. Click Finish.
  • The HelloWorld JavaFX project is created
  • The Main.fx file opens

File:javafx_project_JavaFXPluginTutorial.png

8. Copy the code to the editor

import javafx.stage.*;

import javafx.scene.*;
import javafx.scene.text.*;
import javafx.scene.paint.*;
import javafx.scene.effect.*;


Stage {
title: "JavaFX Hello World"
width: 250
height: 80
scene: Scene {
content: Text {
x: 10 y: 30
font: Font { size: 24 }
fill: Color.BLUE
effect: DropShadow{ offsetX: 3 offsetY: 3}
content: "Hello World!"
}
}
}

REPLACE WITH:

  1. Change your application Title
    1. Change _title: "Application title"_ to _title: "JavaFX Hello World"_
  2. Add Content to your page
    1. Change the font size to 24
    2. Add a Fill to your Text content by dragging a color oject into the text block
      1. Add a "fill:" member to the text block
      2. drag the color you want from the palette and drop it in the code immediately following the "fill:"
    3. Add a Drop Shadow effect to your Text content by dragging a Drop Shadow effect into the Text Block.
      1. Add ae "effect:" member to the text block
      2. drag the Drop Shaddow effect from the palette and drop it in the code immediately following the "effect:"
    4. Change the content from "Application Text" to "Hello World!"

9. Press F6 to run the JavaFX project

  • The JavaFX Hello World application appears

File:javafx_helloworld_JavaFXPluginTutorial.png


JavaFX Script language Tutorial

Change this heading to "To learn more about JavaFX"

Use the JavaFX Tutorial Overview to create JavaFX Script applications which include

  • 2D Graphics
  • UI Controls
  • Effects
  • Animation
  • Video and Audio

Learn more about the JavaFX Script language

JavaFX Plugin Features

  • Editor
  • Code Highlighting
  • Code Completion
  • Source Navigation
  • Code Folding
  • Javadoc
  • Error Detection
  • Refactoring
  • To enable the refactoring add the -J-Djavafx.refactoring=true flag to the netbeans.conf file
  • Palette
  • Deployment
  • Desktop
  • Applet
  • WebStart
  • Mobile Emulator
  • Debuger
  • Profiler
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo