1) What is JavaFX?
JavaFX is a software platform for creating desktop applications or internet application. It uses java library. It can run various devices such as Desktop Computer, Mobile, TVs etc.
2) What are various features of JavaFX?
There are various features of JavaFX:
- It is written in Java.
- It provides an application named scene Builder.
- It is swing interoperability.
- It also provide CSS like styling.
- It has rich set of API's to develop GUI application like 2D and 3D etc.
3) Who is the developer of JavaFX?
Chris Oliver is the developer of JavaFX.
4) What are the important packages of JavaFX API?
There are various important packages of JavaFX API:
- javafx.animation
- javafx.application
- javafx.css
- javafx.event
- javafx.geometry etc.
5) What is Streamer?
Streamer is an open source media engine of JavaFX.
6) What are the three components of JavaFX application?
There are three components of JavaFX application:
- Stage: It contains all the object of JavaFX.
- Scene: It represents the physical contents of JavaFX application.
- Nodes: It is the package of JavaFX.scene that represents a node.
7) Which method is used to create JavaFX application?
Start() method is used to create JavaFX application.
8) What are three life cycle methods of JavaFX application?
There are three life cycle methods of JavaFX application.
9) How can we create a class of sample application in JavaFX?
In JavaFX, we can create a class of sample application by using following codes:
public class JavafxSample extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
}
}
10)Which method is used to launch JavaFX application?
Launch() method is used to launch JavaFX application.
11) What are the various properties of 2D object in JavaFX?
In JavaFX, there are various properties of 2D object that are given below:
- Stroke Type
- Stroke Width
- Stroke Fill
- Stroke
- Stroke Line
- Stroke Miter Limit
12) How can we create a text node in JavaFX?
In javaFX, we can create a text node by using its package
javafx.scene.text.
Example
13) Which method is used to set the color of text in JavaFX?
In JavaFX
setFill() method is used to set the color of text.
Example
text.setFill(Color.BEIGE);
14) What are the various transformations in JavaFX?
There are various transformations in javaFX.
- Translation
- Scaling up and down
- Rotation
- shearing
15) How can we load an image in javaFX?
In JavaFX, we can load an image by using following code:
//Passing FileInputStream object as a parameter
FileInputStream inputstream = new FileInputStream("C:\\images\\image.jpg");
Image image = new Image(inputstream);
//Loading image from URL
//Image image = new Image(new FileInputStream("url for the image));