예제 #1
0
 private static void showTopComponent(int id, Exception exception) {
   String name = "exception" + id;
   TopComponent c = NbComponents.findTopComponentByNameAndClass(name, TopComponent.class);
   if (c == null) {
     c =
         new TopComponent() {
           @Override
           public int getPersistenceType() {
             return TopComponent.PERSISTENCE_NEVER;
           }
         };
     c.setName(name);
     c.setDisplayName(exception.getClass().getSimpleName());
     c.setLayout(new BorderLayout());
     c.add(ExceptionPanel.create(exception), BorderLayout.CENTER);
     c.open();
   }
   c.requestActive();
 }
예제 #2
0
 private static void showDialog(Exception exception) {
   ExceptionPanel p = ExceptionPanel.create(exception);
   DialogDisplayer.getDefault()
       .notify(p.createDialogDescriptor(exception.getClass().getSimpleName()));
 }