0
請考慮將示例程序添加到警報中的示例程序。正如你將看到的,TabPane左側有一個白色填充,我無法刪除。刪除警報的左側填充
如果有人有任何想法,這將是偉大的。
代碼:
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class AlertTest extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Scene scene = new Scene(new HBox());
primaryStage.setScene(scene);
primaryStage.show();
Alert alert = new Alert(Alert.AlertType.NONE);
alert.setTitle("");
alert.initOwner(primaryStage);
TabPane tabPane = new TabPane(new Tab("test"));
tabPane.setPadding(Insets.EMPTY);
alert.getDialogPane().setPadding(Insets.EMPTY);
alert.getDialogPane().setContent(tabPane);
alert.show();
}
}
視覺:
這是一個有點哈克但工作完美:) 謝謝 – Maxoudela