本文整理了Java中javax.swing.JDialog.setSize()
方法的一些代码示例,展示了JDialog.setSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDialog.setSize()
方法的具体详情如下:
包路径:javax.swing.JDialog
类名称:JDialog
方法名:setSize
暂无
代码示例来源:origin: stackoverflow.com
final JDialog d = new JDialog();
d.setSize(200,200);
d.setLocationRelativeTo(null);
d.setVisible(true);
代码示例来源:origin: stanfordnlp/CoreNLP
public void about() {
aboutBox.setSize(360, 240);
aboutBox.setLocation((int)this.getLocation().getX() + 22, (int)this.getLocation().getY() + 22);
aboutBox.setResizable(false);
aboutBox.setVisible(true);
}
代码示例来源:origin: stackoverflow.com
public void newDialog(Object obj){
JDialog dia = new JDialog();
dia.setSize(200,200);
dia.setLocationRelativeTo(obj);
代码示例来源:origin: stackoverflow.com
final JDialog d = new JDialog();
d.setSize(200, 200);
final Toolkit toolkit = Toolkit.getDefaultToolkit();
final Dimension screenSize = toolkit.getScreenSize();
final int x = (screenSize.width - d.getWidth()) / 2;
final int y = (screenSize.height - d.getHeight()) / 2;
d.setLocation(x, y);
d.setVisible(true);
代码示例来源:origin: stackoverflow.com
JDialog dialog = new JDialog(SwingUtilities.windowForComponent(this));
dialog.setModal(true);
dialog.setSize(...);
dialog.setVisible( true );
代码示例来源:origin: entertailion/Fling
/**
* Create a progress indicator
*/
private void createProgressDialog() {
progressDialog = new JDialog(this, resourceBundle.getString("progress.title"), true);
JProgressBar progressBar = new JProgressBar(0, 100);
progressBar.setStringPainted(true);
progressBar.setIndeterminate(true);
progressDialog.add(BorderLayout.CENTER, progressBar);
progressDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
progressDialog.setSize(300, 75);
progressDialog.setLocationRelativeTo(this);
}
代码示例来源:origin: igniterealtime/Openfire
private void installPlugin(final File plugin) {
final JDialog dialog = new JDialog(frame, "Installing Plugin", true);
dialog.getContentPane().setLayout(new BorderLayout());
JProgressBar bar = new JProgressBar();
dialog.getContentPane().add(bar, BorderLayout.CENTER);
dialog.pack();
dialog.setSize(225, 55);
dialog.setVisible(true);
代码示例来源:origin: nodebox/nodebox
public void editMetadata() {
if (getActiveNode() == null) return;
JDialog editorDialog = new NodeAttributesDialog(NodeBoxDocument.this);
editorDialog.setSize(580, 751);
editorDialog.setLocationRelativeTo(NodeBoxDocument.this);
editorDialog.setVisible(true);
}
代码示例来源:origin: stackoverflow.com
final JDialog dialog = new JDialog();
dialog.setUndecorated(true);
dialog.setSize(0, 0);
dialog.setModal(true);
dialog.pack();
代码示例来源:origin: stanfordnlp/CoreNLP
final JDialog dialog = new JDialog(frame, "Jar File Chooser", true);
dialog.setLocation(location);
final JList fileList = new JList(new Vector<>(files));
okay.setText("Okay");
okay.setToolTipText("Okay");
okay.addActionListener(evt -> dialog.setVisible(false));
JButton cancel = new javax.swing.JButton();
cancel.setText("Cancel");
cancel.addActionListener(evt -> {
fileList.clearSelection();
dialog.setVisible(false);
});
dialog.add(cancel);
dialog.pack();
dialog.setSize(dialog.getPreferredSize());
dialog.setVisible(true);
代码示例来源:origin: stackoverflow.com
public static void main(String args[]) {
JFrame window = new JFrame("l");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // <-- Handle closing
// the window.
Color black = new Color(0, 0, 0);
window.setBackground(black);
window.setSize(new Dimension(500, 500)); // <-- set a size.
window.setVisible(true); // <-- set it visible.
JDialog start = new JDialog(window, ";;");
start.setSize(new Dimension(300, 300)); // <-- set a size.
start.setVisible(true); // <-- set it visible.
}
代码示例来源:origin: stackoverflow.com
JDialog dialog = new JDialog();
JLabel label = new JLabel("Test");
dialog.add(label);
// pack(), setSize(), validate() in this order will
// set sizes on all components as wished
dialog.pack();
dialog.setSize(800, 600);
dialog.validate();
System.out.println(label.getSize());
代码示例来源:origin: stanfordnlp/CoreNLP
JButton cancel = new javax.swing.JButton();
JDialog dialog = new JDialog(new Frame(), "Parser Progress", true);
dialog.setSize(300, 150);
dialog.add(BorderLayout.NORTH,
new JLabel("Parsing " + sentences.size() + " sentences"));
dialog.setVisible(true);
代码示例来源:origin: stackoverflow.com
public static void main(String[] args) {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400,400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
JDialog dialog = new JDialog(frame);
dialog.setSize(200,200);
dialog.setLocationRelativeTo(frame);
dialog.setModal(true); // Works also with .setModal(false)
dialog.setVisible(true);
}
代码示例来源:origin: net.jradius/jradius-extended
/**
* This method initializes openUrlDialog
*
* @return javax.swing.JDialog
*/
private JDialog getOpenUrlDialog() {
if (openUrlDialog == null) {
openUrlDialog = new JDialog();
openUrlDialog.setContentPane(getOpenUrlContentPane());
openUrlDialog.setSize(425,125);
}
openUrlStatusLabel.setText("Enter the URL of the configuration file:");
openUrlTextField.setText("http://");
return openUrlDialog;
}
代码示例来源:origin: stackoverflow.com
JDialog first = new JDialog();
first.setSize(new Dimension(80,80));
JDialog second = new JDialog();
second.setSize(new Dimension(80,80));
first.setVisible(true);
second.setVisible(true);
代码示例来源:origin: stackoverflow.com
JDialog dialog=new JDialog(frmInstance);
dialog.setUndecorated(true);
dialog.setVisible(true);
dialog.setSize(200,100);
代码示例来源:origin: com.hynnet/jradius-extended
/**
* This method initializes openUrlDialog
*
* @return javax.swing.JDialog
*/
private JDialog getOpenUrlDialog() {
if (openUrlDialog == null) {
openUrlDialog = new JDialog();
openUrlDialog.setContentPane(getOpenUrlContentPane());
openUrlDialog.setSize(425,125);
}
openUrlStatusLabel.setText("Enter the URL of the configuration file:");
openUrlTextField.setText("http://");
return openUrlDialog;
}
代码示例来源:origin: stackoverflow.com
JDialog d = new JDialog();
d.setSize(200, 200);
d.setVisible(true);
代码示例来源:origin: stackoverflow.com
JDialog dialog = new JDialog(SwingUtilities.windowForComponent(this));
dialog.setModal(true);
dialog.setSize(200, 200);
dialog.setVisible(true);
内容来源于网络,如有侵权,请联系作者删除!