当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionDialog类代码示例

本文整理汇总了Java中org.controlsfx.dialog.ExceptionDialog的典型用法代码示例。如果您正苦于以下问题:Java ExceptionDialog类的具体用法?Java ExceptionDialog怎么用?Java ExceptionDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExceptionDialog类属于org.controlsfx.dialog包,在下文中一共展示了ExceptionDialog类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:26,代码来源:Application.java

示例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();
		}
	}
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:30,代码来源:ImageEditor.java

示例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();
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:9,代码来源:MainWindow.java

示例4: initialize

import org.controlsfx.dialog.ExceptionDialog; //导入依赖的package包/类
public void initialize() 
{
   // get URL of the video file
   URL url = VideoPlayerController.class.getResource("sts117.mp4");
   
   // create a Media object for the specified URL
   Media media = new Media(url.toExternalForm());
   
   // create a MediaPlayer to control Media playback
   mediaPlayer = new MediaPlayer(media);
   
   // specify which MediaPlayer to display in the MediaView
   mediaView.setMediaPlayer(mediaPlayer); 

   // set handler to be called when the video completes playing
   mediaPlayer.setOnEndOfMedia(() -> {
      playing = false;
      playPauseButton.setText("Play");
   });

   // set handler that displays an ExceptionDialog if an error occurs
   mediaPlayer.setOnError(() -> {
      ExceptionDialog dialog = 
         new ExceptionDialog(mediaPlayer.getError());
       dialog.showAndWait();
   });
   
   // bind the MediaView's width/height to the scene's width/height
   DoubleProperty width = mediaView.fitWidthProperty();
   DoubleProperty height = mediaView.fitHeightProperty();
   width.bind(Bindings.selectDouble(
      mediaView.sceneProperty(), "width"));
   height.bind(Bindings.selectDouble(
      mediaView.sceneProperty(), "height")); 
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:36,代码来源:VideoPlayerController.java

示例5: 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();
	}
}
 
开发者ID:lewis007,项目名称:spring-boot-javafx,代码行数:15,代码来源:HomeController.java

示例6: changeAvatar

import org.controlsfx.dialog.ExceptionDialog; //导入依赖的package包/类
private void changeAvatar(File choosen) {
    try {
        String uploaded = FileService.instance().upload(choosen);
        Image image = FileService.instance().getImage(uploaded);
        Core.instance().user().setAvatar(uploaded);
    } catch (IOException ex) {
        ExceptionDialog dialog = new ExceptionDialog(ex);
        dialog.setTitle("Failed to upload image");
        dialog.showAndWait();
    }
}
 
开发者ID:dipu-bd,项目名称:Tuntuni,代码行数:12,代码来源:ProfileController.java

示例7: displayException

import org.controlsfx.dialog.ExceptionDialog; //导入依赖的package包/类
/**
 * Displays a modal dialog box to shows details about an {@link Exception}.
 *
 * @param header the header text for the dialog
 * @param e      the exception to display
 * @param owner  the {@link Node} used to recover the stage the dialog should be linked to
 */
public static void displayException(String header, Throwable e, Node owner) {
    runOnFXThread(() -> {
        ExceptionDialog dlg = new ExceptionDialog(e);
        dlg.initStyle(StageStyle.UTILITY);
        dlg.initOwner(getStage(owner));
        dlg.getDialogPane().setHeaderText(header);
        dlg.showAndWait();
    });
}
 
开发者ID:fthevenet,项目名称:binjr,代码行数:17,代码来源:Dialogs.java

示例8: handleException

import org.controlsfx.dialog.ExceptionDialog; //导入依赖的package包/类
private static void handleException(Throwable exception) {
	ExceptionDialog ed = new ExceptionDialog(exception);
	ed.show();

}
 
开发者ID:talpalaru,项目名称:polTool,代码行数:6,代码来源:PolApplication.java

示例9: showErrorDialogAndWait

import org.controlsfx.dialog.ExceptionDialog; //导入依赖的package包/类
@Override
public void showErrorDialogAndWait(String message, Throwable exception) {
    ExceptionDialog exceptionDialog = new ExceptionDialog(exception);
    exceptionDialog.setHeaderText(message);
    exceptionDialog.showAndWait();
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:7,代码来源:FXDialogService.java


注:本文中的org.controlsfx.dialog.ExceptionDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。