Меню

E fx clipse как установить

Release: JavaFX Scene Builder 1.1

Last Updated: October 2013

[+] Show/Hide Table of Contents

About This Tutorial

1 Using Scene Builder with NetBeans IDE

2 Using Scene Builder with Eclipse IDE

3 Using Scene Builder with IntelliJ IDEA

Profiles

Jerome Cambon

Software Developer, Oracle

Jerome is a member of the JavaFX Scene Builder development team.

Cindy Castillo

Technical Writer, Oracle

Cindy is a technical writer in the JavaFX group. She has written tutorials, online help, and technical articles for Java and JavaFX technologies.

We Welcome Your Comments

If you have questions about JavaFX, please go to the forum.

Using JavaFX Scene Builder with Java IDEs

2 Using Scene Builder with Eclipse IDE

This chapter describes how to download and install the e(fx)clipse tool, which enables you to create a new JavaFX FXML project using Eclipse IDE, start Scene Builder from within the IDE, and run Scene Builder sample applications.

The JavaFX integration with the Eclipse IDE is provided with the e(fx)clipse tool. It is assumed that you have already installed Scene Builder before continuing with the rest of this section. Go to the JavaFX Scene Builder Installation Guide for installation information.

Downloading and Installing e(fx)clipse

Go to http://www.eclipse.org/efxclipse/install.html for information about the available options to download and install the e(fx)clipse tool to use with your JavaFX Scene Builder installation.

The information in this chapter is based on the pre-configured distribution of Eclipse 4.2.2. SDK with e(fx)clipse 0.8.1

Creating a New JavaFX FXML Project

To create a new JavaFX FXML project using Eclipse, you must first create a new JavaFX project and then add a new FXML document to that JavaFX project.

Figure 2-1 Create a New File


Description of «Figure 2-1 Create a New File»

From the New dialog box, expand the JavaFX folder, and select the JavaFX Project wizard, as shown in Figure 2-2.

Figure 2-2 Choose the JavaFX Project Wizard


Description of «Figure 2-2 Choose the JavaFX Project Wizard»

Enter the project name, specify the JRE to use, and select the Project layout option. Click Finish to complete the project creation, as shown in Figure 2-3.

Figure 2-3 Create a New Java Project


Description of «Figure 2-3 Create a New Java Project»

Now create a new FXML document

Right-click the Test folder in the Package Explorer.

Figure 2-4 Create a New FXML Document


Description of «Figure 2-4 Create a New FXML Document»

In the FXML File dialog box, complete the creation of the new FXML document using the following steps:

In the Name field, enter Sample for the FXML file name, as shown in Figure 2-5.

If not already set, specify the FXML document’s root element by clicking Browse and selecting an item from the Find Preloader dialog box. The default value shown is AnchorPane.

Leave Dynamic Root unselected. It is for advanced users who want to manage custom types.

Click Finish to close the dialog box.
You can now complete the creation of your JavaFX FXML layout

Figure 2-5 Finish Creating a New FXML File


Description of «Figure 2-5 Finish Creating a New FXML File»

Editing an FXML File Using Scene Builder

You can edit an FXML file using the Eclipse FXML editor or by opening the file using the JavaFX Scene Builder tool:

In the IDE’s Package Explorer tab, expand the Test and src folders.

A separate window for Scene Builder is opened and displays the Sample.fxml layout in the Content panel area. You may have to increase the size of the default AchorPane that appears in the Content panel. You may start to add controls.

Figure 2-6 Open Sample.fxml File in Scene Builder


Description of «Figure 2-6 Open Sample.fxml File in Scene Builder»

Читайте также:  Как понять можно ли установить 64 битную систему

Use JavaFX Scene Builder User Guide to learn more about the available Scene Builder features and Getting Started with JavaFX Scene Builder to create a simple issue tracking application.

Where to Go From Here

Now that you are familiar with the integration between the Scene Builder tool and Eclipse IDE, look at JavaFX Scene Builder User Guide to learn more about the available Scene Builder features. Follow the steps described in Getting Started with JavaFX Scene Builder to create a simple issue tracking application.

You can also try the sample applications provided with the Scene Builder release. The samples are Netbeans projects, so use the following information to learn how to use a sample using Eclipse IDE.

Using Scene Builder Samples From Eclipse IDE

Use the following information to use the Scene Builder samples. The HelloWorld application is used for illustratative purpose.

Ensure that you have downloaded JavaFX Scene Builder Samples bundle from http://www.oracle.com/technetwork/java/javafx/downloads/index.html and extracted its contents.

Figure 2-7 Create a JavaFX Project for the HelloWorld Sample


Description of «Figure 2-7 Create a JavaFX Project for the HelloWorld Sample»

In the Details section of the Java Settings dialog box, click Link additional source option. The Link Source dialog box is displayed.

Ignore the error “The folder is already a source folder.” because the Folder name field is automatically filled in

Figure 2-8 Open the HelloWorld Sample’s src Folder


Description of «Figure 2-8 Open the HelloWorld Sample’s src Folder»

Run the HelloWorld sample, as shown in Figure 2-9:

In the Project Explorer window, expand the src_samples and helloworld folders for the HelloWorld project.

Right-click the node for the Main.java source file.

Figure 2-9 Run Scene Builder HelloWorld Sample


Description of «Figure 2-9 Run Scene Builder HelloWorld Sample»

The HelloWorld application is displayed, as shown in Figure 2-10.

Figure 2-10 Hello World Sample Running


Description of «Figure 2-10 Hello World Sample Running»

Источник

e(fx)clipse

JavaFX Tooling and Runtime for Eclipse and OSGi

About a short intro

Tooling

Runtime

Platforms

OpenJFX / JavaFX 8 is currently available on Windows, Mac OS X, and Linux as part of the OpenJDK 8 & Oracle JDK 8. Our tooling supports all of these three platforms.

Stay tuned

You can read about the latest developments on BestSolution’s specific blog.

Are you looking for specific support?

Please check out our community section or visit also project’s addons-channel. We are sure you’ll find all answers needed there.

Tooling It’s all about your favorite IDE

By integrating into the Eclipse JDT, e.g., by providing a specialized classpath container, e(fx)clipse allows users to develop JavaFX applications in the same fashion they develop Swing and SWT applications.

By integrating into the Eclipse PDE, e.g., by providing an enhanced PDEClasspath container, e(fx)clipse makes developing JavaFX applications for Eclipse Equinox as easy as developing SWT/Swing applications.

JavaFX 2 allows for defining the UI structure using an XML format named FXML. Unlike other XML formats, FXML has no DTD/Schema but it provides serialization for an arbitrary (JavaFX) object graph, which means standard XML editors are useless when it comes to FXML.

e(fx)clipse is going another route by providing a tooling for a very simple object graph definition language named FXGraph which gets translated into FXML in the background. So you don’t need an extra library at runtime since JavaFX 2 can load FXML files natively.

One of the coolest feature of FXGraph is that it integrates with the Eclipse JDT, giving you for instance the Javadoc for all referenced elements and autocompletion support. The DSL allows the user to attach some extra information (e.g. CSS files) such that the integrated live preview can make use of them.

Читайте также:  Как установить подкрылки на газель некст

Almost all IDEs provide a CSS editor, but this editor only knows about the attributes used inside HTML browser applications. By providing a specialized CSS editor, which knows the CSS properties used by JavaFX 2, authoring CSS files for your JavaFX project is as easy as in web projects.

When you define your UI using FXGraph, you will see immediately the effect of your CSS changes on your application at runtime. This feature helps you try out different CSS settings without having to start and stop your application.

FXML is a DTD/Schema-less XML serialization specification for the definition of JavaFX UIs and Java object graphs in general. e(fx)clipse provides you with advanced tooling for authoring this file format. As the FXML file references Java elements, the editor tightly integrates with the Eclipse JDT such that, for instance, you can see the Javadoc of Java elements like classes and methods in your FXML editor.

Runtime It’s all about frameworks

EMF Edit UI for JavaFX allows you to view your EMF models in JavaFX TextFields, ListViews, TreeViews and TableViews with only a few lines of code. It provides out-of-the-box support for drag & drop, undo / redo, inline editing, dynamic icons, labels and overlays.

The e(fx)clipse standard library provides some useful extensions for writing JavaFX code. The library offers, among other features, additional layout panels people are familiar with in SWT, using Google Guice together with FXML, Eclipse databinding for JavaFX properties, and much more.

Unfortunately, JavaFX was not written with OSGi in mind so there are various sources of error when running inside OSGi. These problems include the location of the JavaFX binaries in your Java installation and class loading issues because of OSGi’s visibility rules. e(fx)clipse provides helper libraries for dealing with all of those problems and makes writing JavaFX applications on top of Eclipse Equinox feel as easy as it is with SWT and Swing.

Once you start developing medium-sized to big JavaFX applications, you’ll ask for a platform that provides a command/handler framework, a generic extension API, dependency injection, etc. Fortunately, such a platform is offered by the Eclipse 4.x SDK which, due to its design, can be used with any UI technology. e(fx)clipse provides so called JavaFX renderers for writing JavaFX RCP applications on this platform.

Источник

3 Using Scene Builder with Login Eclipse IDE

This chapter describes how to download and install the e(fx)clipse tool, which enables you to create a new JavaFX FXML project using Eclipse IDE, start Scene Builder from within the IDE, and run Scene Builder sample applications.

The JavaFX integration with the Eclipse IDE is provided with the e(fx)clipse tool. It is assumed that you have already installed Scene Builder before continuing with the rest of this section. Go to the JavaFX Scene Builder Installation Guide for installation information.

Downloading and Installing e(fx)clipse

Go to http://www.eclipse.org/efxclipse/install.html for information about the available options to download and install the e(fx)clipse tool to use with your JavaFX Scene Builder installation.

The information in this chapter is based on the pre-configured distribution of Eclipse 4.3.1 SDK with e(fx)clipse 0.9.0.201401250805

Creating a New JavaFX FXML Project

To create a new JavaFX FXML project using Eclipse, you must first create a new JavaFX project and then add a new FXML document to that JavaFX project.

Figure 3-1 Create a New File


Description of «Figure 3-1 Create a New File»

Figure 3-2 Choose the JavaFX Project Wizard


Description of «Figure 3-2 Choose the JavaFX Project Wizard»

Enter the project name, specify the JRE to use, and select the Project layout option. Click Finish to complete the project creation, as shown in Figure 3-3.

Читайте также:  Как установить рингтон на айфон 5s через айтюнс ios 10

Figure 3-3 Create a New Java Project


Description of «Figure 3-3 Create a New Java Project»

Now create a new FXML document.

Right-click the Test1 folder in the Package Explorer.

Figure 3-4 Create a New FXML Document


Description of «Figure 3-4 Create a New FXML Document»

In the FXML File dialog box, complete the creation of the new FXML document using the following steps:

In the Name field, enter Sample for the FXML file name, as shown in Figure 3-5.

If not already set, specify the FXML document’s root element by clicking Browse and selecting an item from the Find Preloader dialog box. The default value shown is AnchorPane.

Leave Dynamic Root unselected. It is for advanced users who want to manage custom types.

Click Finish to close the dialog box.
You can now complete the creation of your JavaFX FXML layout.

Figure 3-5 Finish Creating a New FXML File


Description of «Figure 3-5 Finish Creating a New FXML File»

Editing an FXML File Using Scene Builder

You can edit an FXML file using the Eclipse FXML editor or by opening the file using the JavaFX Scene Builder tool:

In the IDE’s Package Explorer tab, expand the Test1 and src folders.

A separate window for Scene Builder is opened and displays the Sample.fxml layout in the Content panel area. You may have to increase the size of the default AnchorPane that appears in the Content panel. You may start to add controls.

Figure 3-6 Open Sample.fxml File in Scene Builder


Description of «Figure 3-6 Open Sample.fxml File in Scene Builder»

Use JavaFX Scene Builder User Guide to learn more about the available Scene Builder features and Getting Started with JavaFX Scene Builder to create a simple issue tracking application.

Where to Go From Here

Now that you are familiar with the integration between the Scene Builder tool and Eclipse IDE, look at JavaFX Scene Builder User Guide to learn more about the available Scene Builder features. Follow the steps described in Getting Started with JavaFX Scene Builder to create a simple issue tracking application.

You can also try the sample applications provided with the Scene Builder release. The samples are Netbeans projects, so use the following information to learn how to use a sample using Eclipse IDE.

Using Scene Builder Samples From Eclipse IDE

Use the following information to use the Scene Builder samples. The Login application is used for illustratative purpose.

Ensure that you have downloaded JavaFX Scene Builder Samples bundle file from the Additional Resources section of the Java SE Download page at http://www.oracle.com/technetwork/java/javase/downloads/index.html and have extracted its contents.

Figure 3-7 Create a JavaFX Project for the Login Sample


Description of «Figure 3-7 Create a JavaFX Project for the Login Sample»

In the Details section of the Java Settings dialog box, click Link additional source option. The Link Source dialog box is displayed.

Ignore the error ”The folder is already a source folder.” because the Folder name field is automatically filled in

Figure 3-8 Open the Login Sample’s src Folder


Description of «Figure 3-8 Open the Login Sample’s src Folder»

Run the Login sample, as shown in Figure 3-9:

In the Project Explorer window, expand the src_samples and login folders for the Login project.

Right-click the node for the Main.java source file.

Figure 3-9 Run Scene Builder Login Sample


Description of «Figure 3-9 Run Scene Builder Login Sample»

The Login application is displayed, as shown in Figure 3-10.

Figure 3-10 Login Sample Running


Description of «Figure 3-10 Login Sample Running»

Источник