Exemplo n.º 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();
 }
Exemplo n.º 2
0
 private static void showDialog(Exception exception) {
   ExceptionPanel p = ExceptionPanel.create(exception);
   DialogDisplayer.getDefault()
       .notify(p.createDialogDescriptor(exception.getClass().getSimpleName()));
 }