为什么JavaFX警报对话框会触发Platform.exit(); 当我按下Enter键时,即使警告对话框中的聚焦按钮是取消?
soaStage.setOnCloseRequest(new EventHandler<WindowEvent>()
{
@Override
public void handle(WindowEvent event)
{
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Confirm");
alert.setHeaderText("Are you sure you want to exit?");
alert.setContentText("Press OK to exit, or Cancel to stay.");
alert.initOwner(soaStage);
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK)
{
Platform.exit();
}
else
{
event.consume();
}
}
});
Run Code Online (Sandbox Code Playgroud) 您好,我对 PostgreSQL/PostGIS 非常陌生,刚刚按照本教程学习了如何将 Shapefiles 转换为 SQL 文件并使用 shp2pgsql 将其导入到 PostGIS 。我注意到,每当我转换 Shapefile 时,它都会生成一个包含 CREATE TABLE 语句的 SQL 文件。现在我的问题是,有没有办法或者甚至可以将新的形状文件(带有新的图层组)插入到现有的表中,而不是创建一个新的表?
我希望我解释得很好。谢谢。