Create TitledPane in JavaFX


Create TitledPane in JavaFX:

________________________________________________

import javafx.application.Application;

import javafx.scene.Scene;

import javafx.scene.control.Label;

import javafx.scene.control.TitledPane;

import javafx.scene.layout.GridPane;

import javafx.stage.Stage;


public class JavaFXTitledPane extends Application {

@Override

public void start(Stage stage) {

GridPane pane = new GridPane();

Label lbl = new Label("Welcome to Java!");

TitledPane tPane = new TitledPane("Click", lbl);

pane.add(tPane, 0, 0);

Scene scene = new Scene(pane, 250, 250);

stage.setTitle("JavaFX TitledPane");

stage.setScene(scene);

stage.show();

}

public static void main(String[] args) {

Application.launch(args);

}


}

_____________________________________________

Dark Hers

https://darkhers.blogspot.com

YouTube

https://youtube.com/@darkhers

Instagram

https://instagram.com/darkhers

Facebook

https://www.facebook.com/darkhers

TikTok

https://www.tiktok.com/@darkhers

Pinterest

https://www.pinterest.co.uk/darkhers

Twitter

https://twitter.com/Dark_Hers

 

Comments

Popular Posts