In today's world most of the applications are created using javaFx because of it's features and javaFx is intended to replace swing.In this tutorial we are going to create a simple hello word application in javaFx using NetbeansIDE. To follow this tutorial you must have.
- Netbeans 7.3 or more recent.
- jdk 1.7 or more recent.
First open netbeans then choose File>>New project or simpy press cntrl+shift+N a new wizard will open like this.
then select JavaFx>> JavaFxApplication and click on next button to proceed.after clicking next button new wizard will open like this
Fill project name main class name which you want to be set for your project ide will automatically generate javaFx enabled platform if you can change it.Your javaFx application is successfully created in project window at left hand side to open it press double click on it but it will contain default program of helloword. paste following code in editor
CODE TO BE PASTE:
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class helloword extends Application
{
@Override
public void start(Stage primaryStage)
@Override
public void start(Stage primaryStage)
{
Label l1 = new Label("Helloword In Java FX");
StackPane root = new StackPane();
root.getChildren().add(l1);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
Label l1 = new Label("Helloword In Java FX");
StackPane root = new StackPane();
root.getChildren().add(l1);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
No comments:
Post a Comment