示例#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.");
    }
  }
 public void setEntry(ExternalFileType entry) {
   this.entry = entry;
   if (entry.getName().isEmpty()) {
     diag.setTitle(newFileTitle);
   } else {
     diag.setTitle(editFileTitle);
   }
   setValues(entry);
 }
示例#3
0
  private void warning(String msg) {
    final JDialog warn;
    JButton ok;
    JLabel message;

    warn = new JDialog();
    warn.setTitle(msg);

    message = new JLabel("CryoBay: " + msg);
    ok = new JButton("Ok");

    ok.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            warn.dispose();
          }
        });

    warn.getContentPane().setLayout(new BorderLayout());
    warn.getContentPane().add(message, "North");
    warn.getContentPane().add(ok, "South");

    warn.setSize(200, 80);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    warn.setLocation(screenSize.width / 2 - 100, screenSize.height / 2 - 40);
    warn.setResizable(false);
    warn.show();
  }
  private void displayFilteredDialog() {
    try {
      log.debug("displayFilteredDialog: subAction name = " + this.m_subAction.sub_action_name());
      // toolbarAction parentAction = getParentAction();

      JDialog initDebaterecord;
      initDebaterecord = new JDialog();
      initDebaterecord.setTitle("Enter Settings for Document");
      initDebaterecord.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
      // initDebaterecord.setPreferredSize(new Dimension(420, 300));

      InitDebateRecord panel =
          new InitDebateRecord(ooDocument, initDebaterecord, m_parentAction, m_subAction);
      // panel.setDialogMode(SelectorDialogModes.TEXT_INSERTION);
      // panel.setBackground(new Color(255, 255, 153));
      // initDebaterecord.setTitle("Selection Mode");
      initDebaterecord.getContentPane().add(panel);
      initDebaterecord.pack();
      initDebaterecord.setLocationRelativeTo(null);
      initDebaterecord.setVisible(true);
      initDebaterecord.setAlwaysOnTop(true);
    } catch (Exception ex) {
      log.error("displayFilteredDialog : " + ex.getMessage());
      log.error(
          "displayFilteredDialog: stack trace :  \n"
              + org.bungeni.ooo.utils.CommonExceptionUtils.getStackTrace(ex));
    }
  }
    @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();
            }
        }
    }
  @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"));
  }
示例#7
0
  /**
   * Constructor creates the send window without passing in information from an opened message. It
   * only opens a new message windows so that the user can send a new mail.
   *
   * @throws MessagingException : Throws exception to the the function where an object of type
   *     SendMessage has been instantiate
   * @throws IOException : Throws exception to the the function where an object of type SendMessage
   *     has been instantiate
   */
  public SendMessage() throws MessagingException, IOException {

    textArea = new JTextArea();
    referenceDefaultTextArea = textArea;
    scrollPane = new JScrollPane(textArea);
    window = new JDialog();
    wrongMailsStringBuilder = new StringBuilder();
    username = "******";
    userPassword = "******";
    width = 800;
    height = 500;
    window.setSize(width, height);
    window.setName("send a new E-Mail");
    window.setTitle("Default");
    window.setVisible(true);

    createToLabel();
    createCcLabel();
    createBccLabel();
    createSubjectLabel();
    createDefaultCcField();
    createDefaultBccField();
    createDefaultSendButton();
    createCancelButton();
    createSaveButton();
    createDefaultFormular();
    createContainer();
    setWindowConfiguration();
  }
  /** 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
 /**
  * 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;
 }
示例#10
0
  private void createPatternDialog() {

    int w = top.getSize().width;
    // int h = top.getSize().height;

    patternDialog = new JDialog(top, true);
    patternDialog.setTitle(rb.getString("dialog.pattern.title"));

    JPanel base = new JPanel(new GridLayout(2, 1));
    patternDialog.getContentPane().add(base);

    JPanel p = new JPanel(new BorderLayout());
    p.setPreferredSize(new Dimension(w * 4 / 10, 0));
    patternField = new JHistoryComboBox();
    p.add(BorderLayout.SOUTH, patternField);
    base.add(p);

    p = new JPanel();

    okPatternDialogButton = new JButton();
    okPatternDialogButton.setText(rb.getString("dialog.common.button.ok.text"));
    patternDialog.getRootPane().setDefaultButton(okPatternDialogButton);
    p.add(okPatternDialogButton);

    cancelPatternDialogButton = new JButton();
    cancelPatternDialogButton.setText(rb.getString("dialog.common.button.cancel.text"));
    p.add(cancelPatternDialogButton);
    base.add(p);

    patternDialog.pack();
  }
 /** 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();
 }
示例#12
0
  private void createEditorDialog() {

    int w = top.getSize().width;
    //      int h = top.getSize().height;

    editorDialog = new JDialog(top, true);
    editorDialog.setTitle(rb.getString("dialog.editor.title"));

    JPanel base = new JPanel(new GridLayout(2, 1));
    editorDialog.getContentPane().add(base);

    JPanel p = new JPanel(new BorderLayout());
    p.setPreferredSize(new Dimension(w * 6 / 10, 0));
    editorChooser = new JFileChooserHistoryComboBox();
    editorChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    p.add(BorderLayout.SOUTH, editorChooser);
    base.add(p);

    p = new JPanel();

    okEditorDialogButton = new JButton();
    okEditorDialogButton.setText(rb.getString("dialog.common.button.ok.text"));
    editorDialog.getRootPane().setDefaultButton(okEditorDialogButton);
    p.add(okEditorDialogButton);

    cancelEditorDialogButton = new JButton();
    cancelEditorDialogButton.setText(rb.getString("dialog.common.button.cancel.text"));
    p.add(cancelEditorDialogButton);
    base.add(p);

    editorDialog.pack();
  }
示例#13
0
 /**
  * Create a new ForceConfigAction.
  *
  * @param frame the parent frame for which to create the dialog
  * @param fsim the force simulator to configure
  */
 public ForceConfigAction(JFrame frame, ForceSimulator fsim) {
   dialog = new JDialog(frame, false);
   dialog.setTitle("Configure Force Simulator");
   JPanel forcePanel = new JForcePanel(fsim);
   dialog.getContentPane().add(forcePanel);
   dialog.pack();
 }
  /**
   * @param editor
   * @param idDialog
   * @param dialog
   * @param title
   */
  public static void setDialogVisible(
      @Nullable Editor editor, String idDialog, JDialog dialog, String title) {
    Point location = null;

    if (editor != null) {
      Point caretLocation = editor.visualPositionToXY(editor.getCaretModel().getVisualPosition());
      SwingUtilities.convertPointToScreen(caretLocation, editor.getComponent());

      String[] position = UtilsPreferences.getDialogPosition(idDialog).split("x");
      if (!(position[0].equals("0") && position[1].equals("0"))) {
        location = new Point(Integer.parseInt(position[0]), Integer.parseInt(position[1]));
      }
    }

    if (location == null) {
      // Center to screen
      dialog.setLocationRelativeTo(null);
    } else {
      dialog.setLocation(location.x, location.y);
    }

    dialog.setTitle(title);
    dialog.pack();
    dialog.setVisible(true);
  }
 /**
  * Show the potential table. Used for DEBUG.
  *
  * @param title Title of the window to be shown.
  */
 public void showTable(String title) {
   JDialog diag = new JDialog();
   diag.getContentPane().add(new JScrollPane(makeTable()));
   diag.pack();
   diag.setVisible(true);
   diag.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   diag.setTitle(title);
 }
 /**
  * This method initializes aboutDialog
  *
  * @return javax.swing.JDialog
  */
 private JDialog getAboutDialog() {
   if (aboutDialog == null) {
     aboutDialog = new JDialog(getJFrame(), true);
     aboutDialog.setTitle("About");
     aboutDialog.setContentPane(getAboutContentPane());
   }
   return aboutDialog;
 }
示例#17
0
  /** Code to create each of the dialogs */
  private void createTargetsDialog() {

    int w = top.getSize().width;
    // int h = top.getSize().height;

    targetsDialog = new JDialog(top, true);
    targetsDialog.setTitle(rb.getString("dialog.targets.title"));

    JPanel base = new JPanel(new GridLayout(4, 1));
    targetsDialog.getContentPane().add(base);

    JPanel p = new JPanel(new GridLayout(2, 1));
    JLabel l = new JLabel(rb.getString("dialog.targets.label.0.text"));
    l.setPreferredSize(new Dimension(w * 6 / 10, 0));
    p.add(l);

    l = new JLabel(System.getProperty("user.dir"));
    l.setOpaque(true);
    l.setBackground(Color.white);
    p.add(l);

    base.add(p);

    p = new JPanel(new GridLayout(2, 1));

    l = new JLabel(rb.getString("dialog.targets.label.1.text"));
    p.add(l);

    leftTargetChooser = new JFileChooserHistoryComboBox();
    p.add(leftTargetChooser);

    base.add(p);

    p = new JPanel(new GridLayout(2, 1));

    l = new JLabel(rb.getString("dialog.targets.label.2.text"));
    p.add(l);

    rightTargetChooser = new JFileChooserHistoryComboBox();
    p.add(rightTargetChooser);

    base.add(p);

    p = new JPanel();

    okTargetsDialogButton = new JButton();
    okTargetsDialogButton.setText(rb.getString("dialog.common.button.ok.text"));
    targetsDialog.getRootPane().setDefaultButton(okTargetsDialogButton);
    p.add(okTargetsDialogButton);

    cancelTargetsDialogButton = new JButton();
    cancelTargetsDialogButton.setText(rb.getString("dialog.common.button.cancel.text"));
    p.add(cancelTargetsDialogButton);

    base.add(p);

    targetsDialog.pack();
  }
  private LinkLabelDialog() {
    dialog = new JDialog();
    panel = new Panel();

    dialog.setTitle("Enter the link label");
    dialog.setModal(true);
    dialog.getContentPane().add(panel.dialogPanel);
    dialog.pack();
  }
示例#19
0
 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);
 }
示例#20
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);
 }
  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());
  }
示例#22
0
  private void createSaveListDialog() {

    int w = top.getSize().width;
    // int h = top.getSize().height;

    saveListDialog = new JDialog(top, true);
    saveListDialog.setTitle(rb.getString("dialog.seveList.title"));

    JPanel base = new JPanel(new BorderLayout());
    saveListDialog.getContentPane().add(base);

    JPanel p = new JPanel(new GridLayout(2, 1));
    JLabel l = new JLabel(rb.getString("dialog.seveList.label.0.text"));
    l.setPreferredSize(new Dimension(w * 6 / 10, 0));
    p.add(l);

    listFileChooser = new JFileChooserHistoryComboBox();
    listFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    p.add(listFileChooser);

    base.add(BorderLayout.NORTH, p);

    p = new JPanel(new GridLayout(6, 1));
    l = new JLabel(rb.getString("dialog.seveList.label.1.text"));
    p.add(l);

    hasIdentical = new JCheckBox();
    hasIdentical.setText(rb.getString("dialog.seveList.checkBox.0.text"));
    p.add(hasIdentical);
    hasDifferent = new JCheckBox(rb.getString("dialog.seveList.checkBox.1.text"));
    p.add(hasDifferent);
    hasLeft = new JCheckBox(rb.getString("dialog.seveList.checkBox.2.text"));
    p.add(hasLeft);
    hasRight = new JCheckBox(rb.getString("dialog.seveList.checkBox.3.text"));
    p.add(hasRight);
    hasNotMarked = new JCheckBox(rb.getString("dialog.seveList.checkBox.4.text"));
    p.add(hasNotMarked);

    base.add(BorderLayout.CENTER, p);

    p = new JPanel();
    okSaveListDialogButton = new JButton();
    okSaveListDialogButton.setText(rb.getString("dialog.common.button.ok.text"));
    saveListDialog.getRootPane().setDefaultButton(okSaveListDialogButton);
    p.add(okSaveListDialogButton);

    cancelSaveListDialogButton = new JButton();
    cancelSaveListDialogButton.setText(rb.getString("dialog.common.button.cancel.text"));
    p.add(cancelSaveListDialogButton);

    base.add(BorderLayout.SOUTH, p);

    saveListDialog.pack();
  }
示例#23
0
 /**
  * Set the title of the window to the given title
  *
  * @param title The window title
  */
 public void setWindowTitle(String title) {
   if (!windowOk()) {
     return;
   }
   if (dialog != null) {
     dialog.setTitle(title);
   }
   if (frame != null) {
     frame.setTitle(title);
   }
 }
示例#24
0
 public void displayDate() {
   for (int x = 7; x < button.length; x++) button[x].setText("");
   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM yyyy");
   java.util.Calendar cal = java.util.Calendar.getInstance();
   cal.set(year, month, 1);
   int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
   int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
   for (int x = 6 + dayOfWeek, day = 1; day <= daysInMonth; x++, day++)
     button[x].setText("" + day);
   l.setText(sdf.format(cal.getTime()));
   d.setTitle("Date Picker");
 }
示例#25
0
  private void showChooser(Container owner, boolean rng, Calendar high, Calendar end) {
    initDialog(owner);
    range = rng;
    scroll = false;
    previous = ref = null;
    result = from = to = null;

    if (high.get(high.YEAR) != month[0].getYear()) {
      setYear(high.get(high.YEAR));
      setPreferredPanelSize();
      main.pack();
    }
    if (rng && end != null)
      setSelection(
          month[high.get(high.MONTH)].getDay(high.get(high.DAY_OF_MONTH)),
          month[end.get(end.MONTH)].getDay(end.get(end.DAY_OF_MONTH)));
    setHighlight(high.get(high.MONTH), high.get(high.DAY_OF_MONTH));
    if (!rng) main.setTitle("Odabir datuma");
    else main.setTitle("Odabir datumskog raspona");
    main.setVisible(true);
  }
示例#26
0
  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);
  }
  public static void main(String[] args) {
    JDialog dlgVentana = new JDialog();
    dlgVentana.setResizable(false);

    GeopistaComparacionPanel iniciar = new GeopistaComparacionPanel();

    dlgVentana.getContentPane().add(iniciar);
    dlgVentana.setSize(750, 600);
    dlgVentana.setVisible(true);
    dlgVentana.setLocation(150, 90);
    dlgVentana.setTitle("Discrepancias de la Información");
    dlgVentana.setResizable(false);
  }
示例#28
0
  public void actionPerformed(ActionEvent e) {
    System.out.println("[*** EditSpeakersAction ***]");
    ApplicationControl ac = (ApplicationControl) applicationControl;
    JDialog dialog = new JDialog(ac.getFrame(), true);
    EditSpeakerPanel editSpeakerPanel = new EditSpeakerPanel(ac.getTranscription());
    dialog.setTitle(FOLKERInternationalizer.getString("dialog.speaker.editspeakers"));
    dialog.getContentPane().add(editSpeakerPanel);
    dialog.pack();
    dialog.setLocationRelativeTo(ac.getFrame());
    dialog.setVisible(true);

    ac.speakersChanged();
  }
示例#29
0
 private void dialog(String title, String cad) {
   JScrollPane scr = new JScrollPane();
   scr.setSize(300, 500);
   JDialog dialogo = new JDialog();
   dialogo.setTitle(title);
   JTextArea area = new JTextArea();
   dialogo.setSize(300, 500);
   area.setSize(300, 500);
   scr.setViewportView(area);
   dialogo.add(scr);
   area.setText(cad);
   dialogo.setVisible(true);
 }
  private void getDialog() {
    GridBagConstraints csTexto = new GridBagConstraints();
    GridBagConstraints csBoton = new GridBagConstraints();

    csTexto.weighty = 1;
    csTexto.gridx = 0;
    csTexto.gridy = 0;

    csBoton.weighty = 1;
    csBoton.gridx = 0;
    csBoton.gridy = 5;

    JLabel correcto = new JLabel("Casillas correctas");
    correcto.setForeground(new Color(0x0095FF));
    JLabel error = new JLabel("Casillas erróneas");
    error.setForeground(Color.red);
    JLabel seleccion = new JLabel("Casilla seleccionada");
    seleccion.setForeground(Color.green);
    JLabel amarillo = new JLabel("Casillas con número seleccionado");
    amarillo.setForeground(Color.yellow);
    JButton boton = new JButton("Cerrar");

    boton.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent arg0) {
            dialogGuide.dispose();
          }
        });

    dialogGuide = new JDialog();
    dialogGuide.setSize(300, 200);
    dialogGuide.setModal(false);
    dialogGuide.setVisible(true);
    dialogGuide.setLocationRelativeTo(this);
    dialogGuide.setTitle("GUIDE");

    dialogGuide.setLayout(new GridBagLayout());
    dialogGuide.getContentPane().setBackground(new Color(0x585858));

    dialogGuide.add(seleccion, csTexto);
    csTexto.gridy = 1;
    dialogGuide.add(amarillo, csTexto);
    csTexto.gridy = 2;
    dialogGuide.add(correcto, csTexto);
    csTexto.gridy = 3;
    dialogGuide.add(error, csTexto);
    csTexto.gridy = 4;
    dialogGuide.add(boton, csBoton);
  }