コード例 #1
1
  @Override
  public void actionPerformed(ActionEvent e) {

    OWLReasoner reasoner = owlManager.getOWLReasonerManager().getCurrentReasoner();

    if (reasoner instanceof QuestOWL) {
      try {
        check = ((QuestOWL) reasoner).getEmptyEntitiesChecker();

        JDialog dialog = new JDialog();
        dialog.setModal(true);
        dialog.setSize(520, 400);
        dialog.setLocationRelativeTo(null);
        dialog.setTitle("Empties Check");

        EmptiesCheckPanel emptiesPanel = new EmptiesCheckPanel(check);
        JPanel pnlCommandButton = createButtonPanel(dialog);
        dialog.setLayout(new BorderLayout());
        dialog.add(emptiesPanel, BorderLayout.CENTER);
        dialog.add(pnlCommandButton, BorderLayout.SOUTH);
        DialogUtils.installEscapeCloseOperation(dialog);

        dialog.pack();
        dialog.setVisible(true);

      } catch (Exception ex) {
        JOptionPane.showMessageDialog(null, "An error occured. For more info, see the logs.");
      }
    } else {
      JOptionPane.showMessageDialog(null, "You have to start ontop reasoner for this feature.");
    }
  }
コード例 #2
0
  void showPasswordDialog(boolean wasWrong) {
    WebPanel passPanel = new WebPanel();
    WebLabel passLabel = new WebLabel(Tr.tr("Please enter your key password:"******"Wrong password"));
      wrongLabel.setForeground(Color.RED);
      passPanel.add(wrongLabel, BorderLayout.SOUTH);
    }
    WebOptionPane passPane =
        new WebOptionPane(
            passPanel, WebOptionPane.QUESTION_MESSAGE, WebOptionPane.OK_CANCEL_OPTION);
    JDialog dialog = passPane.createDialog(mMainFrame, Tr.tr("Enter password"));
    dialog.setModal(true);
    dialog.addWindowFocusListener(
        new WindowAdapter() {
          @Override
          public void windowGainedFocus(WindowEvent e) {
            passField.requestFocusInWindow();
          }
        });
    // blocking
    dialog.setVisible(true);

    Object value = passPane.getValue();
    if (value != null && value.equals(WebOptionPane.OK_OPTION))
      mControl.connect(passField.getPassword());
  }
コード例 #3
0
 /**
  * This method initializes jDialog
  *
  * @return javax.swing.JDialog
  */
 private JDialog getJDialog() {
   if (jDialog == null) {
     jDialog = new JDialog();
     jDialog.setContentPane(getJContentPane());
     jDialog.setTitle(title);
     jDialog.setSize(this.getWidth() + 5, this.getHeight() + 35);
     jDialog.setLayout(new BorderLayout());
     jDialog.getContentPane().add(this, BorderLayout.CENTER);
     jDialog.setModal(true);
     jDialog.setAlwaysOnTop(true);
     GuiUtils.centerOnScreen(jDialog);
     jDialog.setResizable(false);
     jDialog.setAlwaysOnTop(true);
     jDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
     jDialog.addWindowListener(
         new WindowAdapter() {
           public void windowClosing(WindowEvent e) {
             JOptionPane.showMessageDialog(jDialog, "You must enter a password!");
           }
         });
     // getJContentPane().paintImmediately(0, 0, 300, 300);
     jDialog.setIconImage(ImageUtils.getImage("images/neptus-icon.png"));
     jDialog.toFront();
     jDialog.setFocusTraversalPolicy(new PasswordPanelFocusTraversalPolicy());
     jDialog.setVisible(true);
   }
   return jDialog;
 }
コード例 #4
0
ファイル: DialogUI.java プロジェクト: OlivierGEY1/rapla
  protected void init(boolean modal, JComponent content, String[] options) {
    super.setModal(modal);
    m_modal = modal;
    this.setFocusTraversalPolicy(
        new LayoutFocusTraversalPolicy() {
          private static final long serialVersionUID = 1L;

          protected boolean accept(Component component) {
            return !(component instanceof HTMLView);
          }
        });

    this.content = content;

    this.enableEvents(AWTEvent.WINDOW_EVENT_MASK);

    JPanel contentPane = (JPanel) this.getContentPane();
    contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(new BorderLayout());
    contentPane.add(content, BorderLayout.CENTER);
    contentPane.add(jPanelButtonFrame, BorderLayout.SOUTH);
    jPanelButtonFrame.setLayout(new FlowLayout(FlowLayout.CENTER));
    setButtons(options);
    contentPane.setVisible(true);

    /*
      We enable the escape-key for executing the abortCmd. Many thanks to John Zukowski.
         <a href="http://www.javaworld.com/javaworld/javatips/jw-javatip72.html">Java-Tip 72</a>
    */
    KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
    contentPane.getActionMap().put("abort", buttonListener);
    contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(stroke, "abort");
  }
コード例 #5
0
 /** Show the filter dialog */
 public void showDialog() {
   empty_border = new EmptyBorder(5, 5, 0, 5);
   indent_border = new EmptyBorder(5, 25, 5, 5);
   include_panel =
       new ServiceFilterPanel("Include messages based on target service:", filter_include_list);
   exclude_panel =
       new ServiceFilterPanel("Exclude messages based on target service:", filter_exclude_list);
   status_box = new JCheckBox("Filter messages based on status:");
   status_box.addActionListener(this);
   status_active = new JRadioButton("Active messages only");
   status_active.setSelected(true);
   status_active.setEnabled(false);
   status_complete = new JRadioButton("Complete messages only");
   status_complete.setEnabled(false);
   status_group = new ButtonGroup();
   status_group.add(status_active);
   status_group.add(status_complete);
   if (filter_active || filter_complete) {
     status_box.setSelected(true);
     status_active.setEnabled(true);
     status_complete.setEnabled(true);
     if (filter_complete) {
       status_complete.setSelected(true);
     }
   }
   status_options = new JPanel();
   status_options.setLayout(new BoxLayout(status_options, BoxLayout.Y_AXIS));
   status_options.add(status_active);
   status_options.add(status_complete);
   status_options.setBorder(indent_border);
   status_panel = new JPanel();
   status_panel.setLayout(new BorderLayout());
   status_panel.add(status_box, BorderLayout.NORTH);
   status_panel.add(status_options, BorderLayout.CENTER);
   status_panel.setBorder(empty_border);
   ok_button = new JButton("Ok");
   ok_button.addActionListener(this);
   cancel_button = new JButton("Cancel");
   cancel_button.addActionListener(this);
   buttons = new JPanel();
   buttons.setLayout(new FlowLayout());
   buttons.add(ok_button);
   buttons.add(cancel_button);
   panel = new JPanel();
   panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
   panel.add(include_panel);
   panel.add(exclude_panel);
   panel.add(status_panel);
   panel.add(buttons);
   dialog = new JDialog();
   dialog.setTitle("SOAP Monitor Filter");
   dialog.setContentPane(panel);
   dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
   dialog.setModal(true);
   dialog.pack();
   Dimension d = dialog.getToolkit().getScreenSize();
   dialog.setLocation((d.width - dialog.getWidth()) / 2, (d.height - dialog.getHeight()) / 2);
   ok_pressed = false;
   dialog.show();
 }
コード例 #6
0
    @Override
    public void keyPressed(KeyEvent e) {
        int keyCode = e.getKeyCode();

         if(keyCode == KeyEvent.VK_ENTER){
            final JDialog dialog = new JDialog();
            dialog.setTitle("Search results");
            dialog.setModal(true);
            int height = 40;
            
            dialog.setBounds(0, 0, 300, 500);

            JPanel panel = new JPanel();                     
            ArrayList list = DataLayer.search(zoekBalk.getText());
            panel.setLayout(new GridLayout(list.size(), 1));
            
            if(list.size() == 0){
                JOptionPane.showMessageDialog(null, zoekBalk.getText() + " kon niet gevonden worden/ bestaat niet!", "Niet gevonden", JOptionPane.INFORMATION_MESSAGE);
                //panel.add(new JLabel(zoekBalk.getText() + " kon niet gevonden worden/ bestaat niet!"));
            }else{
                for(int i = 0; i < list.size(); i++){
                    panel.add(new JLabel(list.get(i).toString()));
                    height = height + 20;
                }
                dialog.setPreferredSize(new Dimension(200, height));
                dialog.add(panel);
                dialog.pack();
                dialog.setLocationRelativeTo(null);
                dialog.setVisible(true);
                dialog.validate();
            }
        }
    }
コード例 #7
0
  /** Creates a new instance of Main */
  public Main() {

    TextElementModel textElementModel = new TextElementModel();
    DocumentModel documentModel = new DocumentModel();

    DefaultController controller = new DefaultController();

    DisplayViewPanel displayViewPanel = new DisplayViewPanel(controller);
    PropertiesViewPanel propertiesViewPanel = new PropertiesViewPanel(controller);

    controller.addView(displayViewPanel);
    controller.addView(propertiesViewPanel);
    controller.addModel(textElementModel);
    controller.addModel(documentModel);

    textElementModel.initDefault();
    documentModel.initDefault();

    JFrame displayFrame = new JFrame("Display (View 1)");
    displayFrame.getContentPane().add(displayViewPanel, BorderLayout.CENTER);
    displayFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    displayFrame.pack();

    JDialog propertiesDialog = new JDialog(displayFrame, "Properties (View 2)");
    propertiesDialog.setModal(false);
    propertiesDialog.getContentPane().add(propertiesViewPanel, BorderLayout.CENTER);
    propertiesDialog.pack();

    displayFrame.setVisible(true);
    propertiesDialog.setVisible(true);
  }
コード例 #8
0
  /** Show the dialog. if c is null, the dialog will not have a parent. */
  public int showDialog(Component c) {
    Window topLevel = null;
    if (c != null) {
      topLevel = SwingUtilities.getWindowAncestor(c);
    }

    if (topLevel == null) {
      dialog = new JDialog();
      dialog.setModal(true);
    } else if (topLevel instanceof Frame) {
      dialog = new JDialog((Frame) topLevel, true);
    } else if (topLevel instanceof Dialog) {
      dialog = new JDialog((Dialog) topLevel, true);
    }

    dialog.getContentPane().add(this);
    dialog.setDefaultCloseOperation(dialog.DISPOSE_ON_CLOSE);

    dialog.setTitle("Arithmetic operation");
    dialog.pack();
    Misc.centerFrame(dialog);

    dialog.setVisible(true);

    return getDialogResult();
  }
コード例 #9
0
ファイル: MailImport.java プロジェクト: gineer01/jgnucashlib
  /**
   * @param aWritableModel
   * @param store
   * @return
   * @throws MessagingException
   * @throws JAXBException
   */
  private Folder getInputFolder(final GnucashWritableFile aWritableModel, Store store)
      throws MessagingException, JAXBException {
    String folderName = aWritableModel.getUserDefinedAttribute("imap.folder");
    Folder folder = null;
    if (folderName != null) {
      folder = store.getFolder(folderName);
    }
    while (folder == null || !folder.exists()) {
      final JDialog selectFolderDialog = new JDialog((JFrame) null, "Select mail folder");
      selectFolderDialog.getContentPane().setLayout(new BorderLayout());
      final JList folderListBox = new JList(new Vector<String>(getFolders(store)));
      JButton okButton = new JButton("OK");
      okButton.addActionListener(
          new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent aE) {
              if (folderListBox.getSelectedIndices() != null) {
                if (folderListBox.getSelectedIndices().length == 1) {
                  selectFolderDialog.setVisible(false);
                }
              }
            }
          });
      selectFolderDialog.getContentPane().add(new JScrollPane(folderListBox), BorderLayout.CENTER);
      selectFolderDialog.getContentPane().add(okButton, BorderLayout.SOUTH);
      selectFolderDialog.setModal(true);
      selectFolderDialog.pack();
      selectFolderDialog.setVisible(true);
      folderName = folderListBox.getSelectedValue().toString();
      aWritableModel.setUserDefinedAttribute("imap.folder", folderName);
      folder = store.getFolder(folderName);
    }
    return folder;
  }
コード例 #10
0
 public void xtestTiming() {
   final JDialog dialog = new JDialog((JFrame) null, "TestTiming");
   JDesktopPane pane = new JDesktopPane();
   dialog.setContentPane(pane);
   final Object[] f = {null};
   for (int i = 99; i >= 0; i--) {
     JInternalFrame frame = new JInternalFrame("Internal Frame - " + i, true, true, true, true);
     JButton s = new JButton("button" + i);
     s.addActionListener(
         new ActionListener() {
           public void actionPerformed(ActionEvent e) {
             final long start = System.currentTimeMillis();
             System.err.println("TestMarathonNamingStrategy.testTiming(): " + start);
             namingStrategy.setTopLevelComponent(dialog, true);
             String name = namingStrategy.getName((Component) e.getSource());
             System.err.println(
                 "TestMarathonNamingStrategy.testTiming(): name = "
                     + name
                     + "::"
                     + (System.currentTimeMillis() - start));
           }
         });
     f[0] = s;
     frame.getContentPane().add(s);
     frame.pack();
     frame.setLocation(i, i);
     frame.setVisible(true);
     pane.add(frame);
   }
   dialog.setSize(500, 500);
   dialog.setModal(true);
   dialog.setVisible(true);
   System.err.println(
       "TestMarathonNamingStrategy.testTiming(): " + ((Component) f[0]).isVisible());
 }
コード例 #11
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource().equals(add)) {
     remove(add);
     add(cancel);
     invalidate();
     me.validate();
     SelectedEvent.addBVSelectedEventListener(new WaitingForAequi());
     jd =
         new JOptionPane(
                 "Bitte äquivalente ISBN anklicken/scannen!", JOptionPane.INFORMATION_MESSAGE)
             .createDialog("Auswählen");
     jd.setModal(false);
     jd.setVisible(true);
   }
   if (e.getSource().equals(remove)) {
     new Deb(debug, bvc.getSelectedIndex());
     new Deb(debug, bvc.getSelected());
     if (bvc.getSelectedIndex() > -1) {
       OBUBookUse.delEqui(
           Ean.getEan(OBUBookUse.getEquisOfString(isbn).get(bvc.getSelectedIndex())));
     } else {
       new Warn("Keine Äquivalenz gewählt!\n Ignoriere Anweisung.");
     }
     cancel.doClick();
   }
 }
コード例 #12
0
  @SuppressWarnings("static-access")
  public DatePicker(Observer observer, Date selecteddate, Locale locale) {
    super();
    this.locale = locale;
    register(observer);
    screen = new JDialog();
    screen.addWindowFocusListener(this);
    screen.setSize(200, 200);
    screen.setResizable(false);
    screen.setModal(true);
    screen.setUndecorated(true);
    screen.setDefaultLookAndFeelDecorated(true);
    screen.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
    screen.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    screen.getContentPane().setLayout(new BorderLayout());
    //
    calendar = new GregorianCalendar();
    setSelectedDate(selecteddate);
    Calendar c = calendar;
    if (selectedDate != null) c = selectedDate;
    updateScreen(c);
    screen.getContentPane().add(navPanel, BorderLayout.NORTH);

    screen.setTitle(getString("program.title", "Date Picker"));
  }
コード例 #13
0
  @Override
  public void actionPerformed(ActionEvent arg0) {
    try {

      URL url = new URL(excelUrl);
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      int filesize = connection.getContentLength();
      float totalDataRead = 0;
      java.io.BufferedInputStream in = new java.io.BufferedInputStream(connection.getInputStream());
      java.io.FileOutputStream fos = new java.io.FileOutputStream(excelName);
      java.io.BufferedOutputStream bout = new BufferedOutputStream(fos, 14921);
      byte[] data = new byte[14921];
      int i = 0;
      JOptionPane jop2 = new JOptionPane("VitalHealth Test Automation Framework");
      JDialog k2 = jop2.createDialog("Please wait till file is downloaded");
      k2.setModal(false);
      k2.setVisible(true);

      while ((i = in.read(data, 0, 14921)) >= 0) {
        totalDataRead = totalDataRead + i;
        bout.write(data, 0, i);
        float Percent = (totalDataRead * 100) / filesize;
      }
      bout.close();
      in.close();
      // fos.close();
      k2.dispose();

    } catch (Exception e) {
      JOptionPane.showMessageDialog(null, "Sample Configuration file downloaded");
    }
  }
コード例 #14
0
  /** If Certificate was not accepted during installation user must accept it here. */
  public static boolean acceptCertificatePanel(String certificate) throws Exception {
    CertificatePanel CertificatePanel = new CertificatePanel(certificate);
    ResourceBundle bundle = NbBundle.getBundle(AcceptCertificate.class);
    String yesLabel = bundle.getString("MSG_CertificateYesButton");
    String noLabel = bundle.getString("MSG_CertificateNoButton");
    JButton yesButton = new JButton(yesLabel);
    JButton noButton = new JButton(noLabel);

    ActionListener listener =
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            command = e.getActionCommand();
            d.setVisible(false);
          }
        };
    yesButton.addActionListener(listener);
    noButton.addActionListener(listener);

    yesButton.setActionCommand("yes"); // NOI18N
    noButton.setActionCommand("no"); // NOI18N

    yesButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_AcceptButton"));
    yesButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSD_AcceptButton"));

    noButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_RejectButton"));
    noButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSD_RejectButton"));

    int maxWidth = Math.max(yesButton.getPreferredSize().width, noButton.getPreferredSize().width);
    int maxHeight =
        Math.max(yesButton.getPreferredSize().height, noButton.getPreferredSize().height);
    yesButton.setPreferredSize(new Dimension(maxWidth, maxHeight));
    noButton.setPreferredSize(new Dimension(maxWidth, maxHeight));

    d = new JDialog((Frame) null, bundle.getString("MSG_CertificateDlgTitle"), true);

    d.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_CertificateDlg"));
    d.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_CertificateDlg"));

    d.getContentPane().add(CertificatePanel, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11));
    buttonPanel.add(yesButton);
    buttonPanel.add(noButton);
    d.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
    d.setSize(new Dimension(600, 600));
    d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    d.setModal(true);
    d.setResizable(true);
    // Center on screen
    d.setLocationRelativeTo(null);
    d.setVisible(true);

    if ("yes".equals(command)) { // NOI18N
      return true;
    } else {
      return false;
    }
  }
コード例 #15
0
 public static void showViewModal(JPanel view, JDialog dialog) {
   dialog.setModal(true);
   dialog.setContentPane(view);
   dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   dialog.pack();
   dialog.setLocationRelativeTo(null);
   dialog.setVisible(true);
 }
コード例 #16
0
 private static final void showup(JOptionPane jop) {
   JDialog dialog = jop.createDialog(ResourceCenter.TITLE);
   dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   dialog.setIconImages(ResourceCenter.icons);
   dialog.setModal(true);
   dialog.setVisible(true);
   dialog.dispose();
 }
コード例 #17
0
  private LinkLabelDialog() {
    dialog = new JDialog();
    panel = new Panel();

    dialog.setTitle("Enter the link label");
    dialog.setModal(true);
    dialog.getContentPane().add(panel.dialogPanel);
    dialog.pack();
  }
コード例 #18
0
 /**
  * Constructor
  *
  * @param owner The owner of this window
  */
 public DefineAppWindow(MainFrame o, AppEngine engine) {
   super(o, "Application Definition");
   super.setResizable(false);
   super.setModal(true);
   appPanel = new AppPanel(engine);
   init(engine);
   owner = o;
   pack();
 }
コード例 #19
0
  public BreakpointViewBase() {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

    mErrorDialog = new JDialog(SwingUtilities.windowForComponent(this), "Invalid input");
    mErrorDialog.setModal(true);
    mErrorDialog.setSize(new Dimension(400, 100));
    mErrorDialog.setLocationRelativeTo(SwingUtilities.windowForComponent(this));
  }
コード例 #20
0
 public void showAboutDialog() {
   final JDialog splashDialog = new JDialog(getProjectExplorer());
   splashDialog.setModal(true);
   splashDialog.setResizable(false);
   SplashPage page = new SplashPage();
   splashDialog.add(page);
   splashDialog.pack();
   UIUtil.centerOnFrame(splashDialog, getProjectExplorer());
   splashDialog.setVisible(true);
 }
コード例 #21
0
 private void btInserirMouseClicked(
     java.awt.event.MouseEvent evt) { // GEN-FIRST:event_btInserirMouseClicked
   JDialog janela = new FrmInserirCargo(controladora);
   janela.setModal(true);
   janela.setVisible(true);
   if (cbSatus.getSelectedItem().equals("Ativo")) {
     limparTabela();
     preencherTabela();
   }
 } // GEN-LAST:event_btInserirMouseClicked
コード例 #22
0
ファイル: MyFrame.java プロジェクト: akoyro/furman
 public void showDialog() {
   dialog = new JDialog(null, JDialog.ModalityType.TOOLKIT_MODAL);
   dialog.setDefaultCloseOperation(this.defaultCloseOperation);
   dialog.setResizable(true);
   dialog.setModal(true);
   dialog.add(this);
   dialog.pack();
   dialog.setTitle(title);
   dialog.setVisible(true);
 }
コード例 #23
0
 private void editButton() {
   JDialog dialog = new JDialog();
   dialog.getContentPane().add(new EditPersonSkillsPanel(connection, person));
   dialog.setBounds(100, 100, 550, 400);
   dialog.setTitle("Change Skills");
   dialog.setVisible(true);
   dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   dialog.addWindowListener(new EditWindowListener());
   dialog.setModal(true);
 }
コード例 #24
0
  private void initComponents() {

    final SimpleDateFormat dateFrmt = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
    panel = new JPanel();
    panel.setLayout(new BorderLayout());
    JPanel north = new JPanel();
    north.setLayout(new BoxLayout(north, BoxLayout.X_AXIS));
    JLabel dateLbl = new JLabel("検査日:");
    north.add(dateLbl);
    dateFld = new JTextField(10);
    dateFld.setMaximumSize(dateFld.getPreferredSize());
    dateFld.setEditable(false);
    dateFld.setText(dateFrmt.format(new Date()));
    north.add(dateFld);
    north.add(Box.createHorizontalGlue());
    editCheck = new JCheckBox("項目編集");
    north.add(editCheck);
    panel.add(north, BorderLayout.NORTH);

    JPanel south = new JPanel();
    south.setLayout(new FlowLayout());
    deleteBtn = new JButton("削除", deleteIcon);
    deleteBtn.setEnabled(false);
    south.add(deleteBtn);
    closeBtn = new JButton("閉じる", closeIcon);
    south.add(closeBtn);
    saveBtn = new JButton("保存", saveIcon);
    south.add(saveBtn);
    panel.add(south, BorderLayout.SOUTH);

    setTable = new JTable();
    JScrollPane scroll = new JScrollPane(setTable);
    centerPanel = new JPanel();
    centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.X_AXIS));
    centerPanel.add(scroll);
    panel.add(centerPanel, BorderLayout.CENTER);

    templateTable = new JTable();
    templateTable.setToolTipText("DnDで左の施設内検査項目テーブルに追加してください。");
    rtScroll = new JScrollPane(templateTable);
    Dimension d = new Dimension(200, 200);
    rtScroll.setPreferredSize(d);
    d = new Dimension(200, Integer.MAX_VALUE);
    rtScroll.setMaximumSize(d);

    dialog = new JDialog();
    String title = ClientContext.getFrameTitle("院内検査項目追加");
    dialog.setTitle(title);
    dialog.setModal(true);
    dialog.setContentPane(panel);
    ClientContext.setDolphinIcon(dialog);

    dialog.pack();
    dialog.setLocationRelativeTo(chart.getFrame());
  }
コード例 #25
0
 public static JDialog showViewModal(JPanel view) {
   JDialog dialog = new JDialog();
   // if(icon != null) dialog.setIconImage(icon);
   dialog.setModal(true);
   dialog.setContentPane(view);
   dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   dialog.pack();
   dialog.setLocationRelativeTo(null);
   dialog.setVisible(true);
   return dialog;
 }
コード例 #26
0
ファイル: test.java プロジェクト: taepeep/AccountingNote
  public DatePicker(JFrame parent) {
    d = new JDialog();
    d.setModal(true);
    String[] header = {"Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"};
    JPanel p1 = new JPanel(new GridLayout(7, 7));
    p1.setPreferredSize(new Dimension(430, 120));

    for (int x = 0; x < button.length; x++) {
      final int selection = x;
      button[x] = new JButton();
      button[x].setFocusPainted(false);
      button[x].setBackground(Color.white);
      if (x > 6)
        button[x].addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent ae) {
                day = button[selection].getActionCommand();
                d.dispose();
              }
            });
      if (x < 7) {
        button[x].setText(header[x]);
        button[x].setForeground(Color.red);
      }
      p1.add(button[x]);
    }
    JPanel p2 = new JPanel(new GridLayout(1, 3));
    JButton previous = new JButton("<< Previous");
    previous.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            month--;
            displayDate();
          }
        });
    p2.add(previous);
    p2.add(l);
    JButton next = new JButton("Next >>");
    next.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            month++;
            displayDate();
          }
        });
    p2.add(next);
    d.add(p1, BorderLayout.CENTER);
    d.add(p2, BorderLayout.SOUTH);
    d.pack();
    d.setLocationRelativeTo(parent);
    displayDate();
    d.setVisible(true);
  }
コード例 #27
0
ファイル: WindowHolder.java プロジェクト: ethanrd/IDV
  /** Close me */
  public void close() {
    if (dialog != null) {
      dialog.setVisible(false);
      if (dialog.isModal()) {
        dialog.setModal(false);
      }
    }

    if (frame != null) {
      frame.setVisible(false);
    }
  }
コード例 #28
0
ファイル: DBConnection.java プロジェクト: ustadho/Toko-Obat
  public DBConnection(String user, String pass, Component fThis) {
    {
      try {
        url = new StringBuilder();
        url.append("jdbc:postgresql://");
        url.append(resources.getString("server"));
        url.append(":");
        url.append("5432");
        url.append("/");
        url.append(resources.getString("database"));

        System.out.println(url);
        Class.forName("org.postgresql.Driver");
        con = DriverManager.getConnection(url.toString(), user, pass);

        bError = true;
      } catch (java.sql.SQLException se) {
        JOptionPane jfo = new JOptionPane(se.getMessage(), JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = jfo.createDialog(fThis, "Message");
        dialog.setModal(true);
        dialog.setVisible(true);
        bError = false;
        // System.exit(1);
      } catch (ClassNotFoundException ce) {
        JOptionPane jfo = new JOptionPane(ce.getMessage(), JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = jfo.createDialog(fThis, "Message");
        dialog.setModal(true);
        dialog.setVisible(true);
        bError = false;
        // System.exit(1);
      } finally {
        //                try {
        //                    in.close();
        //                } catch (IOException ex) {
        //                    Logger.getLogger(DBConnection.class.getName()).log(Level.SEVERE, null,
        // ex);
        //                }
      }
    }
  }
コード例 #29
0
ファイル: Logger.java プロジェクト: mguetlein/JavaLib
  public void showDialog(Window owner) {
    TextPanel text = new TextPanel();
    text.addParagraph(getText());
    text.setPreferredWith(500);

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout(10, 10));
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));
    JScrollPane scroll = new JScrollPane(text);
    panel.add(scroll);

    final JDialog dialog = new JDialog(owner);

    JButton copy = new JButton("Copy to clipboard");
    copy.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            SwingUtilities.invokeLater(
                new Runnable() {
                  public void run() {
                    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
                    clipboard.setContents(
                        new StringSelection(Logger.this.getText()),
                        new ClipboardOwner() {
                          @Override
                          public void lostOwnership(Clipboard clipboard, Transferable contents) {}
                        });
                  }
                });
          }
        });
    JButton close = new JButton("Close");
    close.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            dialog.setVisible(false);
          }
        });
    panel.add(ButtonBarFactory.buildHelpCloseBar(copy, close), BorderLayout.SOUTH);

    dialog.setModal(true);
    dialog.setTitle("CheS-Mapper Log");
    dialog.getContentPane().add(panel);
    dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    dialog.pack();
    if (dialog.getWidth() > 600 || dialog.getHeight() > 800)
      dialog.setSize(new Dimension(600, 800));
    dialog.setLocationRelativeTo(owner);
    dialog.setVisible(true);
  }
コード例 #30
0
  public void show() {
    parent = new JDialog();
    parent.setModal(true);
    parent.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    parent.setContentPane(this);
    parent.setLocationRelativeTo(querypane);
    parent.pack();
    jButtonAccept.requestFocus();

    DialogUtils.installEscapeCloseOperation(parent);
    DialogUtils.centerDialogWRTParent(querypane, parent);
    parent.setVisible(true);
  }