Data Structure
 Networking
 RDBMS
 Operating System
 Java
 MS Excel
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP
- Selected Reading
 - UPSC IAS Exams Notes
 - Developer's Best Practices
 - Questions and Answers
 - Effective Resume Writing
 - HR Interview Questions
 - Computer Glossary
 - Who is Who
 
Object Oriented Programming Articles - Page 290 of 915
 
			
			804 Views
In the pie chart, we represent the data values as slices of a circle. Each slice is differentiated from other (typically by color). In JavaFX, you can create a pie chart by instantiating the javafx.scene.chart.PieChart class.By default, a JavaFX pie chart contains labels of the slices and a legend − a bar with colors specifying the category represented by each color.Changing the position of the Legend −The PieChart class has a property named legendSide (inherited from the Chart class). This specifies the position of the legend in the chart (left, right, top-bottom). You can set the value to this property ... Read More
 
			
			2K+ Views
A TabPane is a GUI component using which you can load multiple documents in a single window. A tab pane has a title area and a content area, you can switch between tabs by clicking on their respective title. You can create tab pane by instantiating the javafx.scene.control.TabPane class.Creating TabsEach tab in a tab-pane is represented by the javafx.scene.control.Tab class, you can set the title and content of a tab using the setText() and setContent() methods of this class respectively.Once you create all the required tabs you need to add them to the pane as −tabPane.getTabs().addAll(tab1, tab2);ExampleFollowing JavaFX program demonstrates ... Read More
 
			
			795 Views
A SplitPane is a UI component that contains two or more sides with a separator in between. This separator is movable; you can reduce/increase the area of a side using it. You can create a split pane by instantiating the javafx.scene.control.SplitPane class.The sides of the SplitPane can be arranged either horizontally or vertically. By default, the SpliPane created is horizontal you can change its orientation using the setOrientation() method.ExampleThe following Example demonstrates the creation of a SplitPane.import java.io.FileInputStream; import java.io.FileNotFoundException; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.SplitPane; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class SplitPaneExample extends ... Read More
 
			
			650 Views
A menu is a list of options or commands presented to the user, typically menus contain items that perform some action. The contents of a menu are known as menu items and a menu bar holds multiple menus.A button controls in user interface applications, in general, on clicking the button it performs the respective action.A SplitMenuButton provides the functionality of both buttons and a Menu. It is divided into two areas − action area and, menu area. On clicking either of these areas it shows the respective functionality.You can create a split menu button by instantiating the javafx.scene.control.SplitMenuButton class.ExampleThe following ... Read More
 
			
			432 Views
A progress indicator is a circular UI component which is used to indicate the progress of certain action. You can create a progress indicator by instantiating the javafx.scene.control.ProgressIndicator class.ExampleThe following Example demonstrates the creation of a ProgressIndicator.import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.ProgressIndicator; import javafx.scene.control.Slider; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class ProgressIndicatorExample extends Application { public void start(Stage stage) { //Creating a progress indicator ProgressIndicator indicator = new ProgressIndicator(0.6); //Setting the size of the progress bar indicator.setPrefSize(300, 120); ... Read More
 
			
			722 Views
A menu is a list of options or commands presented to the user, typically menus contain items that perform some action. The contents of a menu are known as menu items and a menu bar holds multiple menus.A button controls in user interface applications, in general, on clicking the button it performs the respective action.A MenuButton is simply, a button that shows a menu on clicking it. You can create a menu button by instantiating the javafx.scene.control.MenuButton class.To populate its menu, create a required number of objects of the MenuItem class, add them to the observable list of MenuButton as −menuButton.getItems(item1, ... Read More
 
			
			837 Views
A ChoiceDialog is a dialog box that shows a list of choices from which you can select one. You can create a choice dialog by instantiating the javafx.scene.control.ChoiceDialog class.ExampleThe following Example demonstrates the creation of a ChoiceDialog.import javafx.application.Application; import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ChoiceDialog; import javafx.scene.layout.HBox; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.FontWeight; import javafx.scene.text.Text; import javafx.stage.Stage; public class ChoiceDialogExample extends Application { public void start(Stage stage) { //Creating a choice box ChoiceDialog choiceDialog = new ChoiceDialog("English"); //Retrieving the observable list ObservableList list = choiceDialog.getItems(); ... Read More
 
			
			878 Views
A ButtonBar is simply an HBox on which you can arrange buttons. Typically, the buttons on a ButtonBar are Operating System specific. You can create a button bar by instantiating the javafx.scene.control.ButtonBar class.ExampleThe following Example demonstrates the creation of a ButtonBar.import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ToggleButton; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class ButtonBarExample extends Application { @Override public void start(Stage stage) { //Creating toggle buttons ToggleButton button1 = new ToggleButton("Java"); button1.setPrefSize(60, 40); ToggleButton button2 = new ToggleButton("Python"); ... Read More
 
			
			920 Views
A context menu is a popup menu that appears on interacting with the UI elements in the application. You can create a context menu by instantiating the javafx.scene.control.ContextMenu class. Just like a menu, after creating a context menu, you need to add MenuItems to it.Typically, a context menu appears when you “right-click” on the attached control.Setting ContextMenu to nodes −You can set ContextMenu to any object of the javafx.scene.control class, using the setContextMenu() method.Every node has a property named onContextMenuRequested, this defines a function to be called when a context menu has been requested on this Node. You can set ... Read More
 
			
			2K+ Views
A menu is a list of options or commands presented to the user, typically menus contain items that perform some action. The contents of a menu are known as menu items and a menu bar holds multiple menus.In JavaFX a menu is represented by the javafx.scene.control.Menu class, a menu item is represented by the javafx.scene.control.MenuItem class, And, the javafx.scene.control.MenuBar class represents a menu bar.To create a menu −Instantiate the Menu class.Create a required number of menu items by instantiating the MenuItem class.Add all the menu items to the menu as −fileMenu.getItems().addAll(item1, item2, item3);Create a menu bar by instantiating the MenuBar ... Read More