本文整理了Java中javax.swing.JSpinner.getEditor()
方法的一些代码示例,展示了JSpinner.getEditor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSpinner.getEditor()
方法的具体详情如下:
包路径:javax.swing.JSpinner
类名称:JSpinner
方法名:getEditor
暂无
代码示例来源:origin: stackoverflow.com
JSpinner spinner = ...;
((DefaultEditor) spinner.getEditor()).getTextField().setEditable(false);
代码示例来源:origin: libgdx/libgdx
public void run () {
JComponent focusComponent = component;
if (focusComponent instanceof JSpinner)
focusComponent = ((JSpinner.DefaultEditor)((JSpinner)component).getEditor()).getTextField();
focusComponent.requestFocusInWindow();
}
});
代码示例来源:origin: libgdx/libgdx
public void run () {
JComponent focusComponent = component;
if (focusComponent instanceof JSpinner)
focusComponent = ((JSpinner.DefaultEditor)((JSpinner)component).getEditor()).getTextField();
focusComponent.requestFocusInWindow();
}
});
代码示例来源:origin: stackoverflow.com
final JSpinner spinner = new JSpinner();
JComponent comp = spinner.getEditor();
JFormattedTextField field = (JFormattedTextField) comp.getComponent(0);
DefaultFormatter formatter = (DefaultFormatter) field.getFormatter();
formatter.setCommitsOnValidEdit(true);
spinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
LOG.info("value changed: " + spinner.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
((JSpinner.DefaultEditor)((JSpinner)component).getEditor()).getTextField().setColumns(4);
代码示例来源:origin: libgdx/libgdx
((JSpinner.DefaultEditor)((JSpinner)component).getEditor()).getTextField().setColumns(4);
代码示例来源:origin: wiztools/rest-client
OptionsEtcPanel(){
this.setLayout(new FlowLayout(FlowLayout.LEFT));
jcb_indentResponse.setMnemonic('a');
jcb_syntaxRequest.setToolTipText("Requires RESTClient restart!");
jcb_syntaxResponse.setToolTipText("Requires RESTClient restart!");
JPanel jp = new JPanel();
jp.setLayout(new GridLayout(4, 1));
jp.add(jcb_indentResponse);
jp.add(jcb_syntaxRequest);
jp.add(jcb_syntaxResponse);
JPanel jp_scrollSpeed = new JPanel(new BorderLayout());
JPanel jp_scrollSpeed_inner = new JPanel(new FlowLayout());
jp_scrollSpeed_inner.add(new JLabel("Text areas scroll speed"));
jp_scrollSpeed_inner.add(js_scrollSpeed);
jp_scrollSpeed.add(BorderLayout.WEST, jp_scrollSpeed_inner);
jp.add(jp_scrollSpeed);
((JSpinner.DefaultEditor)js_scrollSpeed.getEditor()).getTextField().setColumns(2);
this.add(jp);
}
代码示例来源:origin: libgdx/libgdx
fontPanel.add(fontSizeSpinner, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0));
((JSpinner.DefaultEditor)fontSizeSpinner.getEditor()).getTextField().setColumns(2);
((JSpinner.DefaultEditor)gammaSpinner.getEditor()).getTextField().setColumns(2);
bitmapPanel.add(gammaSpinner, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0));
paddingPanel.add(padTopSpinner, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
((JSpinner.DefaultEditor)padTopSpinner.getEditor()).getTextField().setColumns(2);
paddingPanel.add(padRightSpinner, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
((JSpinner.DefaultEditor)padRightSpinner.getEditor()).getTextField().setColumns(2);
paddingPanel.add(padLeftSpinner, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST,
GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
((JSpinner.DefaultEditor)padLeftSpinner.getEditor()).getTextField().setColumns(2);
paddingPanel.add(padBottomSpinner, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
((JSpinner.DefaultEditor)padBottomSpinner.getEditor()).getTextField().setColumns(2);
((JSpinner.DefaultEditor)padAdvanceXSpinner.getEditor()).getTextField().setColumns(2);
((JSpinner.DefaultEditor)padAdvanceYSpinner.getEditor()).getTextField().setColumns(2);
代码示例来源:origin: libgdx/libgdx
fontPanel.add(fontSizeSpinner, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0));
((JSpinner.DefaultEditor)fontSizeSpinner.getEditor()).getTextField().setColumns(2);
((JSpinner.DefaultEditor)gammaSpinner.getEditor()).getTextField().setColumns(2);
bitmapPanel.add(gammaSpinner, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0));
paddingPanel.add(padTopSpinner, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
((JSpinner.DefaultEditor)padTopSpinner.getEditor()).getTextField().setColumns(2);
paddingPanel.add(padRightSpinner, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
((JSpinner.DefaultEditor)padRightSpinner.getEditor()).getTextField().setColumns(2);
paddingPanel.add(padLeftSpinner, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST,
GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
((JSpinner.DefaultEditor)padLeftSpinner.getEditor()).getTextField().setColumns(2);
paddingPanel.add(padBottomSpinner, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
((JSpinner.DefaultEditor)padBottomSpinner.getEditor()).getTextField().setColumns(2);
((JSpinner.DefaultEditor)padAdvanceXSpinner.getEditor()).getTextField().setColumns(2);
((JSpinner.DefaultEditor)padAdvanceYSpinner.getEditor()).getTextField().setColumns(2);
代码示例来源:origin: runelite/runelite
Component editor = spinner.getEditor();
JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField();
spinnerTextField.setColumns(SPINNER_FIELD_WIDTH);
Component widthEditor = widthSpinner.getEditor();
JFormattedTextField widthSpinnerTextField = ((JSpinner.DefaultEditor) widthEditor).getTextField();
widthSpinnerTextField.setColumns(4);
Component heightEditor = heightSpinner.getEditor();
JFormattedTextField heightSpinnerTextField = ((JSpinner.DefaultEditor) heightEditor).getTextField();
heightSpinnerTextField.setColumns(4);
代码示例来源:origin: stackoverflow.com
panel.add(spinner);
JComponent field = ((JSpinner.DefaultEditor) spinner.getEditor());
Dimension prefSize = field.getPreferredSize();
prefSize = new Dimension(200, prefSize.height);
代码示例来源:origin: magefree/mage
spinner.setBorder(BorderFactory.createEmptyBorder());
spinner.setModel(new SpinnerNumberModel(0,0,999,1));
editor = ((JSpinner.DefaultEditor) spinner.getEditor());
textField = editor.getTextField();
textField.setHorizontalAlignment(JTextField.LEFT);
代码示例来源:origin: stackoverflow.com
format = ((JSpinner.DateEditor) spinner.getEditor()).getFormat();
format.setTimeZone(TimeZone.getTimeZone(zones[0]));
format.applyPattern("yyyy-MM-dd HH:mm:ss");
代码示例来源:origin: dboissier/mongo4idea
private void updateTextFieldFormat() {
if (timeSpinner == null) return;
JFormattedTextField tf = ((JSpinner.DefaultEditor) timeSpinner.getEditor()).getTextField();
DefaultFormatterFactory factory = (DefaultFormatterFactory) tf.getFormatterFactory();
DateFormatter formatter = (DateFormatter) factory.getDefaultFormatter();
// Change the date format to only show the hours
formatter.setFormat(timeFormat);
}
代码示例来源:origin: stackoverflow.com
JSpinner.NumberEditor jsEditor = (JSpinner.NumberEditor) spinner.getEditor();
final Document jsDoc = jsEditor.getTextField().getDocument();
if (jsDoc instanceof PlainDocument) {
代码示例来源:origin: stackoverflow.com
JFormattedTextField tf = ((JSpinner.DefaultEditor) timeSpinner.getEditor()).getTextField();
DefaultFormatterFactory factory = (DefaultFormatterFactory) tf.getFormatterFactory();
DateFormatter formatter = (DateFormatter) factory.getDefaultFormatter();
代码示例来源:origin: stackoverflow.com
super(new JTextField());
spinner = new JSpinner();
editor = ((JSpinner.DefaultEditor)spinner.getEditor());
textField = editor.getTextField();
textField.addFocusListener( new FocusListener() {
代码示例来源:origin: magefree/mage
((JSpinner.DefaultEditor) this.spnAmount.getEditor()).getTextField().addKeyListener(new KeyListener() {
代码示例来源:origin: com.github.insubstantial/substance
@Override
public Dimension getPreferredSize(JComponent c) {
Dimension nextD = this.nextButton.getPreferredSize();
Dimension previousD = this.prevButton.getPreferredSize();
Dimension editorD = spinner.getEditor().getPreferredSize();
Dimension size = new Dimension(editorD.width, editorD.height);
size.width += Math.max(nextD.width, previousD.width);
Insets insets = this.spinner.getInsets();
size.width += insets.left + insets.right;
size.height += insets.top + insets.bottom;
return size;
}
代码示例来源:origin: Audiveris/audiveris
/**
* Align the spinner display to the right
*
* @param spinner the spinner to update
*/
public static void setRightAlignment (JSpinner spinner)
{
JSpinner.DefaultEditor editor;
editor = (JSpinner.DefaultEditor) spinner.getEditor();
editor.getTextField().setHorizontalAlignment(JTextField.RIGHT);
}
}
内容来源于网络,如有侵权,请联系作者删除!