100% found this document useful (1 vote)
103 views

Java FX

JavaFX is a software for building rich client applications with Java. It provides an API for designing GUI applications that run on almost every device with Java support. Java provides two frameworks for building GUI-based applications: AWT (Abstract Window Toolkit) and Swing. AWT is the older framework that provides the basic GUI components while Swing is built on top of AWT and provides more sophisticated and lightweight components.

Uploaded by

murthy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
103 views

Java FX

JavaFX is a software for building rich client applications with Java. It provides an API for designing GUI applications that run on almost every device with Java support. Java provides two frameworks for building GUI-based applications: AWT (Abstract Window Toolkit) and Swing. AWT is the older framework that provides the basic GUI components while Swing is built on top of AWT and provides more sophisticated and lightweight components.

Uploaded by

murthy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

JAVA FX INTORDUCTION

By using java programming language we can able to


prepare/develop two types of application
• Stand alone application
• Distribution Application
• CUI is a user interface where the user interacts with a computer using
only a keyboard. To perform any action a command is required.

GUI is an user interface where the user interacts with the computer
using graphics. Graphics include icons, navigation bars, images, etc. A
mouse can be used while using this interface to interact with the
graphics. It is a very user-friendly interface and requires no expertise.
Eg: Windows has GUI.
 AWT(Abstract Windowing Toolkit)
It is a Framework, it will provide very good
environment to prepare GUI Applications.

Framework means it is a collection of predefined classes


and interfaces.

It is a collection of predefined classes and interfaces


to prepare desktop applications.

It is an API, is used to prepare window based applications


internally taken Text field with echo character in
password creation
java.awt.class
What is Java Fx
• JavaFX is a software for building rich client applications with Java. It provides an API for
designing GUI applications that run on almost every device with Java support.
Java Provides 2 Frameworks for building GUI-
based applications. Those are
1. AWT-(Abstract Window Toolkit)

2. Swing

3.AWT-(Abstract Window
Container class
• The Container is a component in AWT that can contain another
components like buttons, textfields, labels etc. The Container class
extends Frame and Panel.
Commonly used Methods of Component class
Method Description
add(Component c) inserts a component on this component.
setSize(int width,int height) sets the size (width and height) of the component.
setLayout(LayoutManager m) defines the layout manager for the component.
setVisible(boolean status) changes the visibility of the component, by default false.
To create simple awt example, you need a frame. There are two ways to create a
frame in AWT.
• By extending Frame class (inheritance)
Ex:
class Example extends Frame
{
……..
}
• By creating the object of Frame class (association)
Ex:
class Example {
Frame obj=new Frame();
……..
}
A Simple AWT Example
SimpleExample.java
import java.awt.*;
public class AwtExample
{
public static void main(String[] args)
{
Frame f=new Frame();
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
f.setTitle("Simple Example");
}
}
Output:
Javac AwtExample.java
Java AwtExample

You might also like