本文整理了Java中javax.swing.JTree.requestFocusInWindow()
方法的一些代码示例,展示了JTree.requestFocusInWindow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.requestFocusInWindow()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:requestFocusInWindow
暂无
代码示例来源:origin: apache/pdfbox
@Override
public void actionPerformed(ActionEvent actionEvent)
{
TreePath path = statusObj.getPathForString(statusField.getText());
if (path != null)
{
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
tree.requestFocusInWindow();
}
else
{
statusField.setBorder(errorBorder);
}
}
};
代码示例来源:origin: ron190/jsql-injection
tree.requestFocusInWindow();
代码示例来源:origin: org.netbeans.api/org-openide-explorer
/** Requests focus for the tree component. Overrides superclass method. */
@Override
public boolean requestFocusInWindow() {
return tree.requestFocusInWindow();
}
代码示例来源:origin: com.jidesoft/jide-oss
public void run() {
_fileSystemTree.requestFocusInWindow();
}
};
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/** Requests focus for the tree component. Overrides superclass method. */
public boolean requestFocusInWindow () {
return tree.requestFocusInWindow();
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/** Requests focus for the tree component. Overrides superclass method. */
public boolean requestFocusInWindow () {
return tree.requestFocusInWindow();
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
@Override
public void valueChanged(TreeSelectionEvent e) {
log.debug("value changed, updating currentPath");
currentPath = e.getNewLeadSelectionPath();
// Call requestFocusInWindow to ensure current component loses focus and
// all values are correctly saved
// see https://bz.apache.org/bugzilla/show_bug.cgi?id=55103
// see https://bz.apache.org/bugzilla/show_bug.cgi?id=55459
tree.requestFocusInWindow();
actionHandler.actionPerformed(new ActionEvent(this, 3333, ActionNames.EDIT)); // $NON-NLS-1$
}
代码示例来源:origin: org.apache.uima/uimaj-tools
@Override
public void actionPerformed(ActionEvent arg0) {
this.main.getFsTree().requestFocusInWindow();
}
代码示例来源:origin: org.apache.uima/uimaj-tools
@Override
public void actionPerformed(ActionEvent arg0) {
this.main.getIndexTree().requestFocusInWindow();
}
代码示例来源:origin: omegat-org/omegat
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_UP) {
innerPanel.availablePrefsTree.getActionForKeyStroke(KeyStroke.getKeyStrokeForEvent(e))
.actionPerformed(new ActionEvent(innerPanel.availablePrefsTree, 0, null));
innerPanel.availablePrefsTree.requestFocusInWindow();
e.consume();
}
}
});
代码示例来源:origin: Multibit-Legacy/multibit-hd
@Override
public void run() {
lastSelectionDateTime = Dates.nowUtc();
sidebarTree.setFocusable(true);
sidebarTree.requestFocusInWindow();
}
});
代码示例来源:origin: elki-project/elki
/**
* Display the popup, attached to the given component.
*
* @param parent Parent component
*/
public void show(Component parent) {
Dimension parentSize = parent.getSize();
Insets insets = getInsets();
// reduce the width of the scrollpane by the insets so that the popup
// is the same width as the combo box.
parentSize.setSize(parentSize.width - (insets.right + insets.left), 10 * parentSize.height);
Dimension scrollSize = computePopupBounds(parent, 0, getBounds().height, parentSize.width, parentSize.height).getSize();
scroller.setMaximumSize(scrollSize);
scroller.setPreferredSize(scrollSize);
scroller.setMinimumSize(scrollSize);
super.show(parent, 0, parent.getHeight());
tree.requestFocusInWindow();
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Display the popup, attached to the given component.
*
* @param parent Parent component
*/
public void show(Component parent) {
Dimension parentSize = parent.getSize();
Insets insets = getInsets();
// reduce the width of the scrollpane by the insets so that the popup
// is the same width as the combo box.
parentSize.setSize(parentSize.width - (insets.right + insets.left), 10 * parentSize.height);
Dimension scrollSize = computePopupBounds(parent, 0, getBounds().height, parentSize.width, parentSize.height).getSize();
scroller.setMaximumSize(scrollSize);
scroller.setPreferredSize(scrollSize);
scroller.setMinimumSize(scrollSize);
super.show(parent, 0, parent.getHeight());
tree.requestFocusInWindow();
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-gui-minigui
/**
* Display the popup, attached to the given component.
*
* @param parent Parent component
*/
public void show(Component parent) {
Dimension parentSize = parent.getSize();
Insets insets = getInsets();
// reduce the width of the scrollpane by the insets so that the popup
// is the same width as the combo box.
parentSize.setSize(parentSize.width - (insets.right + insets.left), 10 * parentSize.height);
Dimension scrollSize = computePopupBounds(parent, 0, getBounds().height, parentSize.width, parentSize.height).getSize();
scroller.setMaximumSize(scrollSize);
scroller.setPreferredSize(scrollSize);
scroller.setMinimumSize(scrollSize);
super.show(parent, 0, parent.getHeight());
tree.requestFocusInWindow();
}
代码示例来源:origin: com.jidesoft/jide-oss
public void mousePressed(MouseEvent e) {
if (e.isConsumed()) {
return;
}
TreePath path = preventToggleEvent(e);
if (path != null) {
toggleSelections(new TreePath[]{path});
Object source = e.getSource();
if (source instanceof JTree) {
JTree tree = ((JTree) source);
if (!tree.hasFocus() && tree.isFocusable() && tree.isRequestFocusEnabled()) {
tree.requestFocusInWindow();
}
}
e.consume();
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
revalidate();
pack();
m_tree.requestFocusInWindow();
代码示例来源:origin: Waikato/weka-trunk
revalidate();
pack();
m_tree.requestFocusInWindow();
代码示例来源:origin: chatty/chatty
public void showSettings(String action, Object parameter) {
loadSettings();
notificationSettings.setUserReadPermission(settings.getList("scopes").contains(TokenInfo.Scope.USERINFO.scope));
setLocationRelativeTo(owner);
if (action != null) {
editDirectly(action, parameter);
}
stuffBasedOnPanel();
selection.requestFocusInWindow();
pack();
setVisible(true);
}
代码示例来源:origin: org.zaproxy/zap
@Override
public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) treeAlert.getLastSelectedPathComponent();
if (node != null && node.getUserObject() != null) {
Object obj = node.getUserObject();
if (obj instanceof Alert) {
Alert alert = (Alert) obj;
setMessage(alert.getMessage(), alert.getEvidence());
treeAlert.requestFocusInWindow();
getAlertViewPanel().displayAlert(alert);
} else {
getAlertViewPanel().clearAlert();
}
} else {
getAlertViewPanel().clearAlert();
}
}
});
代码示例来源:origin: omegat-org/omegat
dialog.pack();
innerPanel.availablePrefsTree.requestFocusInWindow();
dialog.setLocationRelativeTo(parent);
dialog.setVisible(true);
内容来源于网络,如有侵权,请联系作者删除!