Found 155 Articles for JavaFX

JavaFX example to create area chart with negative values

Maruthi Krishna
Updated on 18-May-2020 07:02:10

217 Views

The area chart accepts a series of data points (x, y) as input values, connects them using a line, and maps the area between the obtained line and the axis. In JavaFX, you can create an area chart by instantiating the javafx.scene.chart.AreaChart class.While instantiating this class you must pass the two objects of the Axis class representing the x and y-axis (as parameters of the constructor). Since the Axis class is abstract you need to pass objects of its concrete subclasses, NumberAxis (for numerical values) or, CategoryAxis (String values).Area chart with –ve valuesThe XYChart.Data class represents a data point in ... Read More

JavaFX example to create area chart with multiple series

Maruthi Krishna
Updated on 18-May-2020 06:59:27

297 Views

The area chart accepts a series of data points (x, y) as input values, connects them using a line, and maps the area between the obtained line and the axis. In JavaFX you can create an area chart by instantiating the javafx.scene.chart.AreaChart class.While instantiating this class you must pass the two objects of the Axis class representing the x and y-axis (as parameters of the constructor). Since the Axis class is abstract you need to pass objects of its concrete subclasses, NumberAxis (for numerical values) or, CategoryAxis (String values).Area chart with multiple seriesThe XYChart.Data class represents a data point in the ... Read More

How to create a tool tip using JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:55:33

427 Views

A tooltip is a UI element, using which you can provide additional information about the elements in a GUI application.Whenever you hover over the mouse pointer over an element (say, button, label, etc..) in your application, the tooltip displays a hint about it.In JavaFX the tooltip is represented by the javafx.scene.control.Tooltip class, you can create a tooltip by instantiating it.Creating the TooltipThe text property of this class holds the text/hint to be displayed by the current tooltip. You can set the value to this property using the setText() method. Or, you can just pass the text to be displayed (String) ... Read More

How to create a date picker using JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:53:10

291 Views

Typically, a date picker displays a calendar, from which you can browse through different months and pick a date. The picked date is formatted and inputs into the system.In JavaFX the javafx.scene.control.DatePicker class represents the date picker. This contains a text (date) filed and a date chooser. You can either enter the date manually or choose a date using the date chooser.To create a date picker in your application, you need to instantiate this class. You can get the chosen date from the date picker by invoking the getValue() method.Exampleimport javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.DatePicker; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; ... Read More

How to style the separator using CSS in JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:51:31

781 Views

A separator is a horizontal or, the vertical line separating the UI elements of an application. In JavaFX the javafx.scene.control.Separator class represents a separator, to create a separator you need to instantiate this class. You can control the visual appearance of the separator using CSS.You create an alternative style to the separator, by creating a CSS file and enabling it in your application. Once you do so, the created style will be applied to all the separators in the application.The setStyle() method accepts the CSS in string format and applies the specified style to the separator. Using this method you ... Read More

How to create a separator using JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:49:35

713 Views

A separator is a horizontal or, the vertical line separating the UI elements of an application.In JavaFX the javafx.scene.control.Separator class represents a separator, to create a separator you need to instantiate this class. This class has three properties namely −halignment − This property specifies the horizontal alignment of a vertical separator. You can set value to this, using the setHalignment() methodorientation − This property specifies the orientation of the current separator i.e. horizontal or vertical. You can set value to this property using the setOrientation() method.valignment − This property specifies the vertical alignment of a horizontal separator. You can set ... Read More

How to add a separator for a choice box in JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:47:37

378 Views

Choice boxIn JavaFX a choice box is represented by the class javafx.scene.control.ChoiceBox. You can create a choice box by instantiating this class. A choice box holds a small set of multiple choices and, allows you to select only one of them.It has two states −Showing − You can see the list of choices in a choice box.Not Showing − You can see the current choice of the choice boxSeparatorA separator is a horizontal or, the vertical line separating the UI elements of an application. In JavaFX the javafx.scene.control.Separator class represents a separator, to create a separator you need to instantiate ... Read More

How to set a tool tip for a choice box in JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:40:54

275 Views

Choice boxIn JavaFX a choice box is represented by the class javafx.scene.control.ChoiceBox. You can create a choice box by instantiating this class. A choice box holds a small set of multiple choices and, allows you to select only one of them.It has two states −Showing − You can see the list of choices in a choice box.Not Showing − You can see the current choice of the choice boxTooltipWhenever you hover over the mouse pointer over an element (say, button, label etc..) in your application, the tool tip displays a hint about it. In JavaFX the tooltip is represented by ... Read More

Example to set action listeners (behavior) to a ChoiceBox in JavaFX

Maruthi Krishna
Updated on 18-May-2020 06:33:34

1K+ Views

A choice box holds a small set of multiple choices and, allows you to select only one of them. This will have two states showing and not showing. When showing, you can see the list of choices in a choice box and while not showing, it displays the current choice. By default, no option is selected in a choice box.In JavaFX a choice box is represented by the class javafx.scene.control.ChoiceBox. You can create a choice box by instantiating this class.The selectionModel property of this class holds the selection model of the current choice box, you can get the value of ... Read More

How to create a choice box using JavaFX?

Maruthi Krishna
Updated on 18-May-2020 06:28:51

700 Views

A choice box holds a small set of multiple choices and, allows you to select only one of them. This will have two states showing and not showing. When showing, you can see the list of choices in a choice box and while not showing, it displays the current choice. By default, no option is selected in a choice box.In JavaFX a choice box is represented by the class javafx.scene.control.ChoiceBox. You can create a choice box by instantiating this class.This class has a property named items, it is of the type ObservableList and it holds the list of choices to ... Read More

Advertisements