dotfiles/.config/Code/User/History/60cd7900/qQiQ.java

65 lines
1.5 KiB
Java
Raw Normal View History

2024-06-16 18:53:25 +05:00
package com.jb;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Main extends Application{
private int noOfTabs;
private StackPane root;
private Scene scene;
private static Button newTabBtn;
@Override
public void start(Stage stage){
noOfTabs = 1;
root = new StackPane();
scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm());
BrowserTab tab = new BrowserTab();
root.getChildren().add(tab);
// tabPane = new TabPane();
// root.getChildren().add(tabPane);
// BrowserTab1 tab = new BrowserTab1();
// tab.getWebEngine().load("https://www.google.com");
// tabPane.getTabs().add(tab);
initializeButton();
stage.setScene(scene);
stage.show();
}
private void initializeButton(){
newTabBtn = new Button("");
StackPane.setAlignment(newTabBtn, Pos.TOP_LEFT);
newTabBtn.setId("new-tab-button");
newTabBtn.setTranslateX(noOfTabs*150 + 7.5);
root.getChildren().add(newTabBtn);
newTabBtn.setOnAction(e -> {
});
}
public static void main(String[] args){
launch(args);
}
public static Button getNewTabBtn(){
return newTabBtn;
}
}