CH - 14 JavaFX
CH - 14 JavaFX
Java Applets
Forgotten UI in Java
Rahul Talreja
3
GUI in Java
Rahul Talreja
4
AWT
✖ Java was first released with GUI support in
something called the Abstract Windows Toolkit
(AWT)
✖ AWT was replaced by a new library called Swing
Rahul Talreja
5
Swings
✖ Swing was designed primarily for use in desktop
applications
JavaFX
From
A NewJavaFX
language
2.0,for
JavaFX
creating
is written
graphical
in user
Java Starting
from
interfaces...
JDK 8, JavaFX is part of JDK
Rahul Talreja
JavaFX : Program Structure
public class MyProgram
{
// Body of class
}
Becomes:
import javafx.application.Application;
…
public class MyProgram extends Application
{
// Body of class
}
Rahul Talreja
9
JavaFX
First Program
Rahul Talreja
10
Rahul Talreja
12
JavaFX in NetBeans
Rahul Talreja
13
JavaFX in Eclipse
Rahul Talreja
14
JavaFX in Eclipse
Open Eclipse and click on Help. Choose Install a New Software from the list of options
given in the drop down menu.
Rahul Talreja
15
JavaFX in Eclipse
Type e(fx)clipse in the Name and type
http://download.eclipse.org/efxclipse/updates-released/1.2.0/site/in the location.
Press OK to proceed with this repository installation.
Rahul Talreja
16
JavaFX in Eclipse
Click on Select All and click Next.
Rahul Talreja
17
JavaFX in Eclipse
Just click Next to continue with the installation.
Rahul Talreja
18
JavaFX in Eclipse
Now, a software agreement has been shown. Just select the radio box which says I accept
the terms and conditions and click finish.
Rahul Talreja
19
JavaFX in Eclipse
Now, the software is being installing to the eclipse. Once the process gets over, it shows
a pop-up window which asks to restart the eclipse. Just click Restart Now and wait
while restart process gets done.
Rahul Talreja
20
JavaFX in Eclipse
Now, we have installed the new software which enables us to create the new JavaFX
Application directly. We just need to click on file and choose new → project from the drop
down options.
Rahul Talreja
21
JavaFX in Eclipse
Now, we can see that there is a option of JavaFX project. We can now create JavaFX
application directly. Choose JavaFX Project and click Next.
Rahul Talreja
22
Thanks!
Any questions?
You can find me at:
Wechat
Dingtalk
Rahul Talreja