Create TabPane in JavaFX


Create TabPane in JavaFX:

________________________________________________

import javafx.application.Application;

import javafx.scene.Scene;

import javafx.scene.control.Label;

import javafx.scene.control.Tab;

import javafx.scene.control.TabPane;

import javafx.stage.Stage;


public class JavaFXTabPane extends Application {

public void start(Stage stage) {

TabPane tPane = new TabPane();

Tab tab1 = new Tab("Java", new Label("Welcome to Java!"));

Tab tab2 = new Tab("Python", new Label("Welcome to Python!"));

Tab tab3 = new Tab("C#", new Label("Welcome to C#!"));

tPane.getTabs().addAll(tab1, tab2, tab3);

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

stage.setTitle("JavaFX TabPane");

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