 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
How to create a Hyperlink using JavaFX?
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.
Example
The 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, 50, 60));       vbox.getChildren().addAll(link);       //Setting the stage       Group root = new Group(vbox);       Scene scene = new Scene(root, 595, 200, Color.BEIGE);       stage.setTitle("Hyperlink");       stage.setScene(scene);       stage.show();    }    public static void main(String args[]){       launch(args);    } }Advertisements
 