Package javax.swing

Examples of javax.swing.JDialog


  okP.add(oK);

  all.add(moreOptionsPanel, BorderLayout.CENTER);
  all.add(okP, BorderLayout.SOUTH);
 
  final JDialog jd =
    new JDialog(PropertyDialog.getParentFrame(ClassifierPanel.this), "Classifier evaluation options");
  jd.getContentPane().setLayout(new BorderLayout());
  jd.getContentPane().add(all, BorderLayout.CENTER);
  jd.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent w) {
      jd.dispose();
      m_MoreOptions.setEnabled(true);
    }
  });
  oK.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent a) {
      m_MoreOptions.setEnabled(true);
      jd.dispose();
    }
  });
  jd.pack();
 
  // panel height is only available now
  m_ClassificationOutputPanel.setPreferredSize(new Dimension(300, m_ClassificationOutputPanel.getHeight()));
  jd.pack();
 
  jd.setLocation(m_MoreOptions.getLocationOnScreen());
  jd.setVisible(true);
      }
    });

    // Layout the GUI
    JPanel p1 = new JPanel();
View Full Code Here


    JButton browseBut = new JButton("Browse...");
    browseBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          //final JFrame jf = new JFrame("Choose file");
          final JDialog jf = new JDialog((JDialog)LoaderCustomizer.this.getTopLevelAncestor(),
              "Choose file", true);
          jf.setLayout(new BorderLayout());
          //jf.getContentPane().setLayout(new BorderLayout());
          jf.getContentPane().add(m_fileChooser, BorderLayout.CENTER);
          m_fileChooserFrame = jf;
          jf.pack();
          jf.setVisible(true);
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    });
View Full Code Here

  }

  private void quit(boolean log, boolean export) {
    mTimer.stop(); // disable the update timer to avoid new update events
    if (log && downloadingThread != null && downloadingThread.isAlive()) {
      final JDialog info = new JDialog(UiUtilities.getLastModalChildOf(this));
      info.setModal(true);
      info.setUndecorated(true);
      info.toFront();

      JPanel main = new JPanel(new FormLayout("5dlu,pref,5dlu","5dlu,pref,5dlu"));
      main.setBorder(BorderFactory.createLineBorder(Color.black));
      main.add(new JLabel(mLocalizer.msg("downloadinfo","A data update is running. TV-Browser will be closed when the update is done.")), new CellConstraints().xy(2,2));

      info.setContentPane(main);
      info.pack();
      info.setLocationRelativeTo(this);

      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          if(downloadingThread != null && downloadingThread.isAlive()) {
            try {
              downloadingThread.join();
            } catch (InterruptedException e) {
              e.printStackTrace();
            }
          }

          info.setVisible(false);
          info.dispose();
        }
      });

      info.setVisible(true);
    }
    if(log && this.isUndecorated()) {
      switchFullscreenMode();
    }
    if (mShuttingDown) {
View Full Code Here

    } catch (Exception ex) {
      ex.printStackTrace();
      return;
    }

    final JDialog d = new JDialog((JFrame)KnowledgeFlowApp.this.getTopLevelAncestor(),
        "Manage Perspectives", true);
    d.setLayout(new BorderLayout());

    JPanel holder = new JPanel();
    holder.setLayout(new BorderLayout());
    holder.add(m_perspectiveConfigurer, BorderLayout.CENTER);
    JButton okBut = new JButton("OK");
    JButton cancelBut = new JButton("Cancel");
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new GridLayout(1,2));
    butHolder.add(okBut);
    butHolder.add(cancelBut);
    holder.add(butHolder, BorderLayout.SOUTH);
    okBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        VISIBLE_PERSPECTIVES = new TreeSet<String>();

        int[] selected = m_perspectiveConfigurer.getSelectedAttributes();
        for (int i = 0; i < selected.length; i++) {
          String selectedClassName = pClasses.get(i);

          // first check to see if it's in the cache already
          if (PERSPECTIVE_CACHE.get(selectedClassName) == null) {
            // need to instantiate and add to the cache

            try {
              Object p = Class.forName(selectedClassName).newInstance();
              if (p instanceof KFPerspective &&
                  p instanceof JPanel) {
                String title = ((KFPerspective)p).getPerspectiveTitle();
                System.out.println("[KnowledgeFlow] loaded perspective: " + title);

                ((KFPerspective)p).setLoaded(true);
                ((KFPerspective)p).setMainKFPerspective(m_mainKFPerspective);
                PERSPECTIVE_CACHE.put(selectedClassName, (KFPerspective)p);
              }
            } catch (Exception ex) {
              ex.printStackTrace();
            }                                 
          }
          VISIBLE_PERSPECTIVES.add(selectedClassName);
        }
        setupUserPerspectives();

        d.dispose();
      }
    });

    cancelBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        d.dispose();
      }
    });

    d.getContentPane().add(holder, BorderLayout.CENTER);
    /*    d.addWindowListener(new java.awt.event.WindowAdapter() {
      public void windowClosing(java.awt.event.WindowEvent e) {


        d.dispose();
      }
    }); */

    d.pack();
    d.setVisible(true);
  }
View Full Code Here

        ((BeanCustomizer)customizer).setModifiedListener(this);
      }

      ((Customizer)customizer).setObject(bc);
      // final javax.swing.JFrame jf = new javax.swing.JFrame();
      final JDialog d = new JDialog((java.awt.Frame)KnowledgeFlowApp.this.getTopLevelAncestor(), true);
      d.setLayout(new BorderLayout());
      d.getContentPane().add((JComponent)customizer, BorderLayout.CENTER);

      //      jf.getContentPane().setLayout(new BorderLayout());
      //    jf.getContentPane().add((JComponent)customizer, BorderLayout.CENTER);
      if (customizer instanceof CustomizerCloseRequester) {
        ((CustomizerCloseRequester)customizer).setParentWindow(d);
      }
      d.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          if (customizer instanceof CustomizerClosingListener) {
            ((CustomizerClosingListener)customizer).customizerClosing();
          }
          d.dispose();
        }
      });
      //      jf.pack();
      //    jf.setVisible(true);
      d.pack();
      d.setLocationRelativeTo(KnowledgeFlowApp.this);
      d.setVisible(true);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here

    gb.setConstraints(error, gc); panel.add(error);
    gb.setConstraints(strut, gc); panel.add(strut);
    JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE,
        JOptionPane.OK_CANCEL_OPTION);
    pane.setInitialValue(field);
    JDialog dlog = pane.createDialog(frame, Strings.get("circuitNameDialogTitle"));
    dlog.addWindowFocusListener(new WindowFocusListener() {
      public void windowGainedFocus(WindowEvent arg0) {
        field.requestFocus();
      }

      public void windowLostFocus(WindowEvent arg0) { }
    });
   
    while (true) {
      field.selectAll();
      dlog.pack();
      dlog.setVisible(true);
      field.requestFocusInWindow();
      Object action = pane.getValue();
      if (action == null || !(action instanceof Integer)
          || ((Integer) action).intValue() != JOptionPane.OK_OPTION) {
        return null;
View Full Code Here

  }

  private void showProgramList() {
    try {
      if (mDialog == null) {
        mDialog = new JDialog(getParentFrame());
        mDialog.setTitle(mLocalizer.msg("name", "Important programs"));
        mDialog.getContentPane().setLayout(new BorderLayout(0, 10));
        ((JPanel) mDialog.getContentPane()).setBorder(Borders.DIALOG_BORDER);

        UiUtilities.registerForClosing(new WindowClosingIf() {
View Full Code Here

    try {
      UIThreadRunner.invokeAndWait(new Runnable() {

        @Override
        public void run() {
          JDialog dialog = new JDialog(parentWin);
          dialog.setModal(modal);
          result.set(dialog);
        }
      });
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
View Full Code Here

          break;
        }
      }
    }

    mDialog = new JDialog(parent, title);
    UiUtilities.registerForClosing(this);

    final JPanel jcontentPane = new JPanel(new BorderLayout(0, 10));
    jcontentPane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
    mDialog.setContentPane(jcontentPane);
View Full Code Here

    dialog.hide();
  }

  public void initDialog(Widget parent) throws GUIException {
    if (parent == null)
      dialog = new JDialog(); // this is perfectly valid
    else if (parent instanceof Dialog)
      dialog = new JDialog((JDialog) parent.getRealWidget(), isModal);
    else if (parent instanceof Frame)
      dialog = new JDialog((JFrame) parent.getRealWidget(), isModal);
    else if (parent instanceof Wizard)
      dialog = new JDialog((JFrame) parent.getRealWidget(), isModal);
    else
      throw new GUIException("Invalid parent (no Dialog/Frame/Wizard/null)");
  }
View Full Code Here

TOP

Related Classes of javax.swing.JDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.