本文整理了Java中javax.swing.JSpinner.requestFocus()
方法的一些代码示例,展示了JSpinner.requestFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSpinner.requestFocus()
方法的具体详情如下:
包路径:javax.swing.JSpinner
类名称:JSpinner
方法名:requestFocus
暂无
代码示例来源:origin: omegat-org/omegat
private void enableDisableDateTo() {
boolean enable = form.m_dateToCB.isSelected();
form.m_dateToSpinner.setEnabled(enable);
form.m_dateToButton.setEnabled(enable);
if (enable) {
// move focus to date spinner
form.m_dateToSpinner.requestFocus();
} else {
// move focus to search edit field
form.m_searchField.requestFocus();
}
}
代码示例来源:origin: omegat-org/omegat
private void enableDisableDateFrom() {
boolean enable = form.m_dateFromCB.isSelected();
form.m_dateFromSpinner.setEnabled(enable);
form.m_dateFromButton.setEnabled(enable);
if (enable) {
// move focus to date spinner
form.m_dateFromSpinner.requestFocus();
} else {
// move focus to search edit field
form.m_searchField.requestFocus();
}
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-ui
private void setSpinnerDate(Date date) {
spinner.setVisible(date != null);
if (date != null) {
picker.setToolTipText(TOOLTIP2);
spinner.setValue(date);
spinner.requestFocus();
} else {
picker.setToolTipText(TOOLTIP1);
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@Override
public boolean requestFocus(boolean temporary) {
if (getEditor() instanceof NumberEditor) {
JFormattedTextField ftf = ((NumberEditor) getEditor()).getTextField();
return ftf.requestFocus(temporary);
}
return super.requestFocus(temporary);
}
代码示例来源:origin: org.geotools/gt2-widgets-swing
/**
* Commits the currently edited values. If commit fails, focus will be set on the offending
* field.
*
* @throws ParseException If at least one of currently edited value couldn't be commited.
*/
public void commitEdit() throws ParseException {
JSpinner focus=null;
try {
(focus=tmin).commitEdit();
(focus=tmax).commitEdit();
(focus=xmin).commitEdit();
(focus=xmax).commitEdit();
(focus=ymin).commitEdit();
(focus=ymax).commitEdit();
(focus=xres).commitEdit();
(focus=yres).commitEdit();
checkAngle(focus=xmin, false);
checkAngle(focus=xmax, false);
checkAngle(focus=ymin, true);
checkAngle(focus=ymax, true);
} catch (ParseException exception) {
focus.requestFocus();
throw exception;
}
}
内容来源于网络,如有侵权,请联系作者删除!