本文整理汇总了Java中org.controlsfx.dialog.ExceptionDialog.show方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionDialog.show方法的具体用法?Java ExceptionDialog.show怎么用?Java ExceptionDialog.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.controlsfx.dialog.ExceptionDialog
的用法示例。
在下文中一共展示了ExceptionDialog.show方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.controlsfx.dialog.ExceptionDialog; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
logger.info(getRuntimeDetails());
Point mousePosition = MouseInfo.getPointerInfo().getLocation();
stage.setX(mousePosition.getX());
stage.setY(mousePosition.getY());
try {
dataStorage = new DataStorage();
} catch (IOException ex) {
logger.error("Could not initialize working directory", ex);
ExceptionDialog exceptionDialog = new ExceptionDialog(ex);
exceptionDialog.setTitle("Error");
exceptionDialog.setHeaderText("Could not initialize working directory");
exceptionDialog.show();
return;
}
new MainWindow(stage);
stage.setMaximized(true);
}
示例2: saveImage
import org.controlsfx.dialog.ExceptionDialog; //导入方法依赖的package包/类
@FXML
void saveImage() {
if (image == null) {
Alert a = new Alert(AlertType.ERROR);
a.setContentText("No image to export!");
a.show();
}
FileChooser fileChooser = new FileChooser();
fileChooser.setInitialDirectory(Preferences.getPath("lastImageDir").toFile());
fileChooser.setTitle("Save image");
fileChooser.getExtensionFilters().addAll(
new ExtensionFilter("PNG Images", "*.png"));
File selected = fileChooser.showSaveDialog(getScene().getWindow());
if (selected != null) {
Preferences.setPath("lastImageDir", selected.toPath());
try {
ImageIO.write(image.toBufferedImage(), "png", selected);
} catch (IOException e) {
logger.error("Error while saving the image.", e);
ExceptionDialog exceptionDialog = new ExceptionDialog(e);
exceptionDialog.setTitle("Error");
exceptionDialog.setHeaderText("Error while saving the image.");
exceptionDialog.show();
}
}
}
示例3: showError
import org.controlsfx.dialog.ExceptionDialog; //导入方法依赖的package包/类
private void showError(String message, Exception ex) {
logger.error(message, ex);
ExceptionDialog exceptionDialog = new ExceptionDialog(ex);
exceptionDialog.setTitle("Error");
exceptionDialog.setHeaderText(message);
exceptionDialog.show();
}
示例4: showWebsite
import org.controlsfx.dialog.ExceptionDialog; //导入方法依赖的package包/类
@FXML
public void showWebsite() {
try {
Node node = websiteController.initView();
content.setContent(node);
websiteController.initConstuct();
} catch (Exception e) {
Stage stage = springContext.getBean(Stage.class);
ExceptionDialog ex = new ExceptionDialog(e);
ex.initOwner(stage);
ex.show();
}
}
示例5: handleException
import org.controlsfx.dialog.ExceptionDialog; //导入方法依赖的package包/类
private static void handleException(Throwable exception) {
ExceptionDialog ed = new ExceptionDialog(exception);
ed.show();
}