import
javafx.application.Application;
import
javafx.scene.Scene;
import
javafx.scene.layout.*;
import
javafx.stage.Stage;
import
javafx.scene.Group;
import
javafx.scene.control.*;
import
java.io.*;
import
javafx.scene.image.*;
public
class
Tab_2
extends
Application {
public
void
start(Stage stage)
{
try
{
stage.setTitle(
"creating Tab"
);
Tab tab_1 =
new
Tab(
"Tab_1"
);
Label label =
new
Label(
" This is a tab "
);
tab_1.setContent(label);
FileInputStream input =
new
FileInputStream(
"f:\\gfg.png"
);
Image image =
new
Image(input);
ImageView imageview =
new
ImageView(image);
tab_1.setGraphic(imageview);
TabPane tabpane =
new
TabPane(tab_1);
Scene scene =
new
Scene(tabpane,
600
,
500
);
stage.setScene(scene);
stage.show();
}
catch
(Exception e) {
System.err.println(e.getMessage());
}
}
public
static
void
main(String args[])
{
launch(args);
}
}