本文整理了Java中javax.swing.JMenu.requestFocus()
方法的一些代码示例,展示了JMenu.requestFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenu.requestFocus()
方法的具体详情如下:
包路径:javax.swing.JMenu
类名称:JMenu
方法名:requestFocus
暂无
代码示例来源:origin: ron190/jsql-injection
@Override
public void actionPerformed(ActionEvent e) {
JMenuItem item = (JMenuItem) e.getSource();
MenuBarCoder.this.menu.setText(item.getText());
MenuBarCoder.this.menu.requestFocus();
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = FOCUS_JSDOC)
@Override
public void focus() {
super.requestFocus();
}
代码示例来源:origin: robward-scisys/sldeditor
/**
* Sets the selected data.
*
* @param selectedData the new selected data
*/
public void setSelectedData(ValueComboBoxData selectedData) {
this.selectedData = selectedData;
if (selectedData != null) {
this.menu.setText(selectedData.getText());
this.menu.requestFocus();
}
if (listener != null) {
listener.optionSelected(selectedData);
}
}
代码示例来源:origin: com.jidesoft/jide-oss
/**
* Invoked when the mouse has been clicked on the menu. This method clears or sets the selection path of the
* MenuSelectionManager.
*
* @param e the mouse event
*/
public void mousePressed(MouseEvent e) {
JMenu menu = (JMenu) menuItem;
if (!menu.isEnabled())
return;
setMouseOver(true);
if (!SwingUtilities.isLeftMouseButton(e)) {
return;
}
if (isClickOnButton(e, menu)) {
if (((JideSplitButton) menuItem).isButtonEnabled()) {
// click button
menu.getModel().setArmed(true);
menu.getModel().setPressed(true);
}
if (!menu.hasFocus() && menu.isRequestFocusEnabled()) {
menu.requestFocus();
}
}
else {
downButtonPressed(menu);
}
}
代码示例来源:origin: com.jidesoft/jide-oss
/**
* Invoked when the mouse has been clicked on the menu. This method clears or sets the selection path of the
* MenuSelectionManager.
*
* @param e the mouse event
*/
public void mousePressed(MouseEvent e) {
JMenu menu = (JMenu) menuItem;
if (!menu.isEnabled())
return;
setMouseOver(true);
if (!SwingUtilities.isLeftMouseButton(e)) {
return;
}
if (isClickOnButton(e, menu)) {
if (((JideSplitButton) menuItem).isButtonEnabled()) {
// click button
menu.getModel().setArmed(true);
menu.getModel().setPressed(true);
}
if (!menu.hasFocus() && menu.isRequestFocusEnabled()) {
menu.requestFocus();
}
}
else {
downButtonPressed(menu);
}
}
代码示例来源:origin: com.jidesoft/jide-oss
/**
* Invoked when the mouse has been clicked on the menu. This method clears or sets the selection path of the
* MenuSelectionManager.
*
* @param e the mouse event
*/
public void mousePressed(MouseEvent e) {
JMenu menu = (JMenu) menuItem;
if (!menu.isEnabled())
return;
setMouseOver(true);
if (!SwingUtilities.isLeftMouseButton(e)) {
return;
}
if (isClickOnButton(e, menu)) {
if (((JideSplitButton) menuItem).isButtonEnabled()) {
// click button
menu.getModel().setArmed(true);
menu.getModel().setPressed(true);
}
if (!menu.hasFocus() && menu.isRequestFocusEnabled()) {
menu.requestFocus();
}
}
else {
downButtonPressed(menu);
}
}
内容来源于网络,如有侵权,请联系作者删除!