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