Java 3D Desktop Environment旨在使用Java 3D来创建一个3D桌面环境。功能包括:分布式的应用程序

源代码在线查看: defaultexceptionhandler.java

软件大小: 1221 K
上传用户: spy0207
关键词: Java Environment Desktop 3D
下载地址: 免注册下载 普通下载 VIP

相关代码

				package org.j3de.exception;         
				
				import java.lang.reflect.InvocationTargetException;
				
				import javax.swing.SwingUtilities;
				import javax.swing.JOptionPane;
				
				public class DefaultExceptionHandler extends ExceptionHandler {
				
				  protected void handleExceptionImpl(final Exception e) {
				    Runnable showException = new Runnable() {
				      public void run() {                                   
				        e.printStackTrace();
				        JOptionPane.showMessageDialog(null, e, e.getMessage(), JOptionPane.ERROR_MESSAGE);
				      }
				    };
				
				    SwingUtilities.invokeLater(showException);
				  }
				
				  protected void handleFatalExceptionImpl(final Exception e) {
				    Runnable showException = new Runnable() {
				      public void run() {                                   
				        e.printStackTrace();
				        JOptionPane.showMessageDialog(null, e, e.getMessage(), JOptionPane.ERROR_MESSAGE);    
				      }
				    };
				   
				    try {
				      SwingUtilities.invokeAndWait(showException);      
				    } catch (InterruptedException ex) {
				      ex.printStackTrace();
				    } catch (InvocationTargetException ex) {
				      ex.printStackTrace();
				    }
				  }  
				  
				  protected void handleWarningImpl(final String msg) {
				    Runnable showException = new Runnable() {
				      public void run() {                                   
				        JOptionPane.showMessageDialog(null, msg, "Warning", JOptionPane.WARNING_MESSAGE);    
				      }
				    };
				
				    SwingUtilities.invokeLater(showException);
				  }
				
				
				}
							

相关资源