Java Code Examples for javax.swing.JDialog#setMinimumSize()
The following examples show how to use
javax.swing.JDialog#setMinimumSize() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainView.java From HiJson with Apache License 2.0 | 6 votes |
private void showMessageDialog(String title,String msg){ if(msg==null) msg = ""; String ex = "com.google.gson.stream.MalformedJsonException:"; int index = msg.indexOf(ex); if(index>=0){ msg = msg.substring(index+ex.length()); } JDialog dlg = new JDialog(getFrame()); dlg.setTitle(title); dlg.setMinimumSize(new Dimension(350, 160)); BorderLayout layout = new BorderLayout(); dlg.getContentPane().setLayout(layout); dlg.getContentPane().add(new JLabel("异常信息:"), BorderLayout.NORTH); JTextArea ta = new JTextArea(); ta.setLineWrap(true); ta.setText(msg); ta.setWrapStyleWord(true); dlg.getContentPane().add(new JScrollPane(ta), BorderLayout.CENTER); MainApp.getApplication().show(dlg); }
Example 2
Source File: RemoteExecutionDialog.java From snap-desktop with GNU General Public License v3.0 | 6 votes |
@Override protected void onAboutToShow() { JDialog dialog = getJDialog(); dialog.setMinimumSize(new Dimension(650, 590)); LoadingIndicator loadingIndicator = getLoadingIndicator(); int threadId = getNewCurrentThreadId(); Path remoteTopologyFilePath = getRemoteTopologyFilePath(); ReadRemoteTopologyTimerRunnable runnable = new ReadRemoteTopologyTimerRunnable(this, loadingIndicator, threadId, remoteTopologyFilePath) { @Override protected void onSuccessfullyFinish(RemoteTopology remoteTopology) { onFinishReadingRemoteTopoloy(remoteTopology); } }; runnable.executeAsync(); }
Example 3
Source File: KeyImporterView.java From pgptool with GNU General Public License v3.0 | 5 votes |
@Override protected JDialog initDialog(Window owner, Object constraints) { JDialog ret = new JDialog(owner, ModalityType.APPLICATION_MODAL); ret.setLayout(new BorderLayout()); ret.setResizable(true); ret.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); ret.setTitle(Messages.get("action.importKey")); ret.add(pnl, BorderLayout.CENTER); ret.setMinimumSize(new Dimension(spacing(60), spacing(30))); initWindowGeometryPersister(ret, "keyImprt"); return ret; }
Example 4
Source File: EncryptTextView.java From pgptool with GNU General Public License v3.0 | 5 votes |
@Override protected JDialog initDialog(Window owner, Object constraints) { JDialog ret = new JDialog(owner, ModalityType.MODELESS); ret.setLayout(new BorderLayout()); ret.setResizable(true); ret.setMinimumSize(new Dimension(UiUtils.getFontRelativeSize(80), UiUtils.getFontRelativeSize(40))); ret.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); ret.setTitle(Messages.get("action.encryptText")); ret.add(pnl, BorderLayout.CENTER); initWindowGeometryPersister(ret, "encrText"); return ret; }
Example 5
Source File: KeysListView.java From pgptool with GNU General Public License v3.0 | 5 votes |
@Override protected JDialog initDialog(Window owner, Object constraints) { JDialog ret = new JDialog(owner, ModalityType.APPLICATION_MODAL); ret.setMinimumSize(new Dimension(spacing(50), spacing(25))); ret.setLayout(new BorderLayout()); ret.setResizable(true); ret.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); ret.setTitle(Messages.get("term.keysList")); ret.add(panelRoot, BorderLayout.CENTER); ret.setJMenuBar(menuBar); initWindowGeometryPersister(ret, "keysList"); return ret; }
Example 6
Source File: DecryptTextView.java From pgptool with GNU General Public License v3.0 | 5 votes |
@Override protected JDialog initDialog(Window owner, Object constraints) { JDialog ret = new JDialog(owner, ModalityType.MODELESS); ret.setLayout(new BorderLayout()); ret.setResizable(true); ret.setMinimumSize(new Dimension(UiUtils.getFontRelativeSize(80), UiUtils.getFontRelativeSize(40))); ret.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); ret.setTitle(Messages.get("action.decryptText")); ret.add(pnl, BorderLayout.CENTER); initWindowGeometryPersister(ret, "decrText"); return ret; }
Example 7
Source File: EncryptOneView.java From pgptool with GNU General Public License v3.0 | 5 votes |
@Override protected JDialog initDialog(Window owner, Object constraints) { JDialog ret = new JDialog(owner, ModalityType.MODELESS); ret.setLayout(new BorderLayout()); ret.setResizable(true); ret.setMinimumSize(new Dimension(UiUtils.getFontRelativeSize(50), UiUtils.getFontRelativeSize(40))); ret.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); ret.setTitle(Messages.get("action.encrypt")); ret.add(pnl, BorderLayout.CENTER); initWindowGeometryPersister(ret, "encrOne"); return ret; }
Example 8
Source File: EditRosterService.java From Shuffle-Move with GNU General Public License v3.0 | 5 votes |
@Override public void onSetupGUI() { d = new JDialog(getOwner(), getString(KEY_TITLE)); d.setTitle(getString(KEY_TITLE)); d.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; c.weighty = 0.0; c.gridx = 1; c.gridy = 1; c.gridwidth = 1; c.gridheight = 1; d.add(makeUpperPanel(), c); c.gridy += 1; c.fill = GridBagConstraints.BOTH; c.weighty = 1.0; d.add(makeCenterPanel(), c); c.gridy += 1; c.fill = GridBagConstraints.HORIZONTAL; c.weighty = 0.0; d.add(makeBottomPanel(), c); ConfigManager preferencesManager = getUser().getPreferencesManager(); int defaultWidth = preferencesManager.getIntegerValue(KEY_POPUP_WIDTH, DEFAULT_POPUP_WIDTH); int defaultHeight = preferencesManager.getIntegerValue(KEY_POPUP_HEIGHT, DEFAULT_POPUP_HEIGHT); int width = preferencesManager.getIntegerValue(KEY_EDIT_ROSTER_WIDTH, defaultWidth); int height = preferencesManager.getIntegerValue(KEY_EDIT_ROSTER_HEIGHT, defaultHeight); d.repaint(); d.pack(); d.setMinimumSize(new Dimension(getMinimumWidth(), DEFAULT_POPUP_HEIGHT)); d.setSize(new Dimension(width, height)); d.setLocationRelativeTo(null); d.setResizable(true); addActionListeners(); setDialog(d); getUser().addObserver(this); }
Example 9
Source File: NamesAssociationDialog.java From snap-desktop with GNU General Public License v3.0 | 5 votes |
@Override public int show() { setButtonID(0); final JDialog dialog = getJDialog(); if (!shown) { dialog.pack(); center(); } dialog.setMinimumSize(dialog.getSize()); dialog.setVisible(true); shown = true; return getButtonID(); }
Example 10
Source File: PingerPanel.java From wandora with GNU General Public License v3.0 | 5 votes |
protected void openInOwnWindow(Wandora w) { JDialog dialog = new JDialog(w, false); dialog.add(this); dialog.setSize(600, 380); dialog.setMinimumSize(new Dimension(600, 380)); dialog.setLocationRelativeTo(w); dialog.setVisible(true); dialog.setTitle(PANEL_TITLE); }
Example 11
Source File: RedditExtractorUI.java From wandora with GNU General Public License v3.0 | 5 votes |
public void open(Wandora w, Context c) { context = c; wandora = w; accepted = false; dialog = new JDialog(w, true); dialog.setSize(800, 500); dialog.setMinimumSize(new Dimension(600, 400)); dialog.add(this); threadSearchSubmit.setText("Search"); threadSearchSubmit.setEnabled(true); dialog.setTitle("Reddit API extractor"); UIBox.centerWindow(dialog, w); dialog.setVisible(true); }
Example 12
Source File: ProLogWindow.java From triplea with GNU General Public License v3.0 | 4 votes |
private void settingsDetailsButtonActionPerformed() { final JDialog dialog = new JDialog(this, "Pro AI - Settings Details"); String message = ""; if (tabPaneMain.getSelectedIndex() == 0) { // Debugging message = "Debugging\r\n" + "\r\n" + "AI Logging: When this is checked, the AI's will output their logs, as they come " + "in, so you can see exactly what the AI is thinking.\r\n" + "Note that if you check this on, you still have to press OK then reopen the " + "settings window for the logs to actually start displaying.\r\n" + "\r\n" + "Log Depth: This setting lets you choose how deep you want the AI logging to be. " + "Fine only displays the high-level events, like the start of a phase, etc.\r\n" + "Finer displays medium-level events, such as attacks, reinforcements, etc.\r\n" + "Finest displays all the AI logging available. Can be used for detailed analysis, " + "but is a lot harder to read through it.\r\n" + "\r\n" + "Pause AI's: This checkbox pauses all the AI's while it's checked, so you can look " + "at the logs without the AI's outputting floods of information.\r\n" + "\r\n" + "Limit Log History To X Rounds: If this is checked, the AI log information will " + "be limited to X rounds of information.\r\n"; } final JTextArea label = new JTextArea(message); label.setFont(new Font("Segoe UI", Font.PLAIN, 12)); label.setEditable(false); label.setAutoscrolls(true); label.setLineWrap(false); label.setFocusable(false); label.setWrapStyleWord(true); label.setLocation(0, 0); dialog.setBackground(label.getBackground()); dialog.setLayout(new BorderLayout()); final JScrollPane pane = new JScrollPane(); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); pane.setViewportView(label); dialog.add(pane, BorderLayout.CENTER); final JButton button = new JButton("Close"); button.setMinimumSize(new Dimension(100, 30)); button.addActionListener(e -> dialog.dispose()); dialog.add(button, BorderLayout.SOUTH); dialog.setMinimumSize(new Dimension(500, 300)); dialog.setSize(new Dimension(800, 600)); dialog.setResizable(true); dialog.setLocationRelativeTo(this); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.setVisible(true); }
Example 13
Source File: EditTeamService.java From Shuffle-Move with GNU General Public License v3.0 | 4 votes |
@Override public void onSetupGUI() { d = new JDialog(getOwner(), getString(KEY_TITLE)); d.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; c.weighty = 0.0; c.gridx = 1; c.gridy = 1; c.gridwidth = 2; c.gridheight = 1; d.add(makeUpperPanel(), c); c.gridy += 1; c.fill = GridBagConstraints.BOTH; c.weighty = 1.0; c.gridwidth = 1; d.add(makeRosterPanel(), c); c.gridx += 1; c.weightx = 0.0; d.add(makeTeamPanel(), c); c.weightx = 1.0; c.gridx = 1; c.gridy += 1; c.gridwidth = 2; c.fill = GridBagConstraints.HORIZONTAL; c.weighty = 0.0; d.add(makeBottomPanel(), c); ConfigManager preferencesManager = getUser().getPreferencesManager(); int defaultWidth = preferencesManager.getIntegerValue(KEY_POPUP_WIDTH, DEFAULT_POPUP_WIDTH); int defaultHeight = preferencesManager.getIntegerValue(KEY_POPUP_HEIGHT, DEFAULT_POPUP_HEIGHT); int width = preferencesManager.getIntegerValue(KEY_EDIT_TEAM_WIDTH, defaultWidth); int height = preferencesManager.getIntegerValue(KEY_EDIT_TEAM_HEIGHT, defaultHeight); d.repaint(); d.pack(); d.setMinimumSize(new Dimension(getMinimumWidth(), DEFAULT_POPUP_HEIGHT)); d.setSize(new Dimension(width, height)); d.setLocationRelativeTo(null); d.setResizable(true); addActionListeners(); setDialog(d); }
Example 14
Source File: MoveChooserService.java From Shuffle-Move with GNU General Public License v3.0 | 4 votes |
@Override public void onSetupGUI() { d = new JDialog(getOwner()); d.setLayout(new GridBagLayout()); d.setTitle(getString(KEY_TITLE)); shuffleMenuBar = new ShuffleMenuBar(getUser(), getOwner()); d.setJMenuBar(shuffleMenuBar); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; c.weightx = 1.0; c.weighty = 1.0; c.gridy = 1; // Display row c.weighty = 1.0; c.gridwidth = 4; c.gridx = 1; c.gridy++; c.gridx++; results = new ArrayList<SimulationResult>(); resultsMap = new HashMap<SimulationResult, Integer>(); model2 = new DefaultTableModel(getColumnNames(), 0) { private static final long serialVersionUID = 5180830497930828902L; @Override public boolean isCellEditable(int row, int col) { return false; } }; table = new JTable(model2); loadOrderFor(table, getUser().getPreferencesManager().getStringValue(KEY_COLUMN_ORDER)); resizeColumnWidth(table); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listener2 = new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { pushSelectionToUser2(); } }; table.getSelectionModel().addListSelectionListener(listener2); JScrollPane jsp = new JScrollPane(table); d.add(jsp, c); // Control row c.weighty = 0.0; c.gridwidth = 1; c.gridx = 1; c.gridy++; c.gridx++; metricLabel = new JLabel(getString(KEY_METRIC_LABEL)); metricLabel.setHorizontalAlignment(SwingConstants.CENTER); metricLabel.setHorizontalTextPosition(SwingConstants.CENTER); metricLabel.setToolTipText(getString(KEY_METRIC_TOOLTIP)); d.add(metricLabel, c); c.gridx++; ind = new GradingModeIndicator(getUser()); ind.setToolTipText(getString(KEY_METRIC_TOOLTIP)); d.add(ind, c); c.gridx++; doMoveButton = new JButton(new AbstractAction(getString(KEY_DO_NOW)) { private static final long serialVersionUID = -8952138130413953491L; @Override public void actionPerformed(ActionEvent arg0) { doMovePressed(); } }); doMoveButton.setToolTipText(getString(KEY_DO_TOOLTIP)); d.add(doMoveButton, c); setDefaultButton(doMoveButton); c.gridx++; closeButton = new JButton(new DisposeAction(getString(KEY_CLOSE), this)); closeButton.setToolTipText(getString(KEY_CLOSE_TOOLTIP)); d.add(closeButton, c); d.pack(); ConfigManager preferencesManager = getUser().getPreferencesManager(); final int width = preferencesManager.getIntegerValue(KEY_CHOOSER_WIDTH, DEFAULT_CHOOSER_WIDTH); final int height = preferencesManager.getIntegerValue(KEY_CHOOSER_HEIGHT, DEFAULT_CHOOSER_HEIGHT); d.setSize(width, height); d.repaint(); Integer x = preferencesManager.getIntegerValue(KEY_CHOOSER_X); Integer y = preferencesManager.getIntegerValue(KEY_CHOOSER_Y); if (x != null && y != null) { d.setLocation(x, y); } else { d.setLocationRelativeTo(null); } d.setMinimumSize(MIN_SIZE); d.setResizable(preferencesManager.getBooleanValue(KEY_CHOOSER_RESIZE, DEFAULT_RESIZE)); getUser().addObserver(this); setDialog(d); }