Use HTML5 Geolocation API for Latitude and Longitude

Rishi Rathor
Updated on 18-May-2020 08:28:23

807 Views

HTML5 Geolocation API lets you share your location with your favorite websites. A JavaScript can capture your latitude and longitude and can be sent to backend web server and do fancy location-aware things like finding local businesses or showing your location on a map.The geolocation APIs work with a new property of the global navigator object ie. Geolocation object.ExampleYou can try to run the following code to find the current location using the Geolocation API, with Latitude and Longitude coordinatesLive Demo                    function showLocation(position) {           ... Read More

Create Hyperlink Using JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:21:20

430 Views

A Hyperlink is a UI component that responds to clicks and rollovers. You can create a hyperlink by instantiating the javafx.scene.control.Hiperlink class.ExampleThe following Example demonstrates the creation of a Hyperlink.import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Hyperlink; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class HiperlinkExample extends Application {    public void start(Stage stage) {       //Creating a hyper link       Hyperlink link = new Hyperlink("https://www.tutorialspoint.com");       //Creating a vbox to hold the pagination       VBox vbox = new VBox();       vbox.setSpacing(5);       vbox.setPadding(new Insets(50, 50, ... Read More

Create Color Picker Using JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:19:36

436 Views

A color picker gives you a standard color palette fro which you can select a required color. You can create a color picker by instantiating the javafx.scene.control.ColorPicker class.ExampleThe following Example demonstrates the creation of a ColorPicker.import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ColorPicker; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.FontWeight; import javafx.stage.Stage; public class ColorPickerExample extends Application {    public void start(Stage stage) {       //Setting the label       Label label = new Label("Select Desired Color:");       Font font = Font.font("verdana", FontWeight.BOLD, FontPosture.REGULAR, 12);       ... Read More

Edit ComboBox in JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:18:00

1K+ Views

A combo box is similar to a choice box it holds multiple items and, allows you to select one of them. It can be formed by adding scrolling to a drop-down list. You can create a combo box by instantiating the javafx.scene.control.ComboBox class.The ComboBox class has a method known as editable (boolean), which specifies whether the current Combobox allows user input. You can set the value to this property using the setEditable() method.Therefore, to edit a JavaFX ComboBox invoke the setEditable() method on it by passing the boolean value true as a parameter.Exampleimport javafx.application.Application; import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.scene.Group; ... Read More

Create ComboBox Using JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:14:25

2K+ Views

A combo box is similar to a choice box it holds multiple items and, allows you to select one of them. It can be formed by adding scrolling to a drop-down list. You can create a combo box by instantiating the javafx.scene.control.ComboBox class.ExampleThe following Example demonstrates the creation of a ComboBox.import javafx.application.Application; import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.stage.Stage; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.FontWeight; public class ComboBoxExample extends Application {    public void start(Stage stage) {       //Setting the label       Label label = new ... Read More

Set Slider to Progress Bar in JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:12:42

515 Views

ProgressBar − A progress bar is an indicator of the advancement of an event (a series of steps). You can create a progress bar by instantiating the javafx.scene.control.ProgressBar class.Slider − JavaFX provides a class known as Slider, this represents a slider component that displays a continuous range of values. This contains a track on which the numerical values are displayed. Along the track, there is a thumb pointing to the numbers. You can provide the maximum, minimum, and initial values of the slider.ExampleIn the following example, we are setting the slider to the ProgressBar.import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import ... Read More

Create a Progress Bar Using JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:10:11

1K+ Views

A progress bar is an indicator of the advancement of an event (a series of steps). You can create a progress bar by instantiating the javafx.scene.control.ProgressBar class.ExampleThe following Example demonstrates the creation of a ProgressBar.import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ProgressBar; import javafx.scene.control.ProgressIndicator; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class ProgressBarExample extends Application {    public void start(Stage stage) {       //Creating a progress bar       ProgressBar progress = new ProgressBar();       //Setting value to the progress bar       progress.setProgress(0.5);       //Creating a progress indicator   ... Read More

Implementing the Page Factory in Pagination

Maruthi Krishna
Updated on 18-May-2020 08:08:20

347 Views

Pagination divides content up between pages and allows users to skip between pages or go in order through the content. You can create pagination by instantiating the javafx.scene.control.Pagination class.ExampleThe following Example demonstrates hoe to create pagination and add data to it.import java.io.FileInputStream; import java.io.InputStream; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Pagination; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.scene.paint.Color; import javafx.stage.Stage; public class PaginationAction extends Application {    public ImageView pageContent(int pageIndex){       try{          //Creating the image view          ImageView imageView = new ImageView();          //Setting the image view ... Read More

Create Pagination Using JavaFX

Maruthi Krishna
Updated on 18-May-2020 08:05:47

550 Views

Pagination divides content up between pages and allows users to skip between pages or go in order through the content. You can create pagination by instantiating the javafx.scene.control.Pagination class.ExampleThe following Example demonstrates the creation of a Pagination.import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Pagination; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class PaginationExample extends Application {    public void start(Stage stage) {       //Creating a pagination       Pagination pagination = new Pagination();       //Setting number of pages       pagination.setPageCount(10);       //Creating a vbox to hold the pagination   ... Read More

Use HTML5 localStorage and sessionStorage

Nancy Den
Updated on 18-May-2020 08:00:52

581 Views

HTML5 introduced two mechanisms, similar to HTTP session cookies, for storing structured data on the client side and to overcome the following drawbacks.Cookies are included with every HTTP request, thereby slowing down your web application by transmitting the same data.Cookies are limited to about 4 KB of data. Not enough to store required data.The two mechanisms for storage are session storage and local storage and they would be used to handle different situations.Session StorageThe Session Storage is designed for scenarios where the user is carrying out a single transaction but could be carrying out multiple transactions in different windows at ... Read More

Advertisements