本文整理了Java中javax.swing.JSpinner.getSize()
方法的一些代码示例,展示了JSpinner.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSpinner.getSize()
方法的具体详情如下:
包路径:javax.swing.JSpinner
类名称:JSpinner
方法名:getSize
暂无
代码示例来源:origin: stackoverflow.com
SpinnerModel saModel = new SpinnerNumberModel(11, 1, 36, 1);
JSpinner saSpinner = new JSpinner(saModel);
Dimension d = saSpinner.getSize();
d.width = 20;
saSpinner.setSize(d);
// Object[] message = { "Choose the key number for sa.", saSpinner };
JPanel panel = new JPanel();
panel.add(new JLabel("Choose the key number for sa:"));
panel.add(saSpinner);
JOptionPane optionPane = new JOptionPane(panel,
JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
JDialog dialog = optionPane.createDialog(frame, "Change Sa Key");
dialog.setVisible(true);
代码示例来源:origin: stackoverflow.com
SpinnerModel saModel = new SpinnerNumberModel(11, 1, 36, 1);
JSpinner saSpinner = new JSpinner(saModel);
Dimension d = saSpinner.getSize();
d.width = 20;
saSpinner.setSize(d);
JPanel panel = new JPanel();
panel.add(new JLabel("Choose the key number for sa:"));
panel.add(saSpinner);
int selection = JOptionPane.showConfirmDialog(frame, panel, "Change Sa Key",
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
if (selection == JOptionPane.OK_OPTION) {
System.out.println("Sa Key is: " + saModel.getValue().toString());
}
代码示例来源:origin: org.scijava/scijava-ui-swing
new SpinnerNumberModelFactory().createModel(value, min, max, stepSize);
spinner = new JSpinner(spinnerModel);
Dimension spinnerSize = spinner.getSize();
spinnerSize.width = 50;
spinner.setPreferredSize(spinnerSize);
内容来源于网络,如有侵权,请联系作者删除!