Available Methods
- putClientProperty ( )
- getClientProperty ( )
- add ( )
- setBorder ( )
- getHeight ( )
- setOpaque ( )
- setEnabled ( )
- getBorder ( )
- getWidth ( )
- setForeground ( )
- setBackground ( )
- isEnabled ( )
- getInsets ( )
- isOpaque ( )
- getParent ( )
- setToolTipText ( )
- setFont ( )
- removeMouseListener ( )
- getPreferredSize ( )
- getActionMap ( )
- setBounds ( )
- setMaximumSize ( )
- setPreferredSize ( )
- getComponents ( )
- getBackground ( )
- setLayout ( )
- setCursor ( )
- addMouseListener ( )
- paint ( )
- isVisible ( )
- getName ( )
- getFontMetrics ( )
- removeAll ( )
- repaint ( )
- addMouseMotionListener ( )
- removeMouseMotionListener ( )
- setAlignmentX ( )
- setInheritsPopupMenu ( )
- removeFocusListener ( )
- setVisible ( )
- getInputMap ( )
- removePropertyChangeListener ( )
- print ( )
- addFocusListener ( )
- setMinimumSize ( )
- isShowing ( )
- addPropertyChangeListener ( )
- getComponentCount ( )
- addKeyListener ( )
- revalidate ( )
- getComponent ( )
- getSize ( )
- getMaximumSize ( )
- getFont ( )
- getTransferHandler ( )
- getMinimumSize ( )
- getLocationOnScreen ( )
- getVisibleRect ( )
- setAutoscrolls ( )
- setFocusable ( )
- doLayout ( )
- addMouseWheelListener ( )
- getBounds ( )
- setSize ( )
- removeKeyListener ( )
- setFocusTraversalKeys ( )
- addHierarchyListener ( )
- removeMouseWheelListener ( )
- invalidate ( )
- addComponentListener ( )
- inside ( )
- AccessibleJComponent ( )
- hasFocus ( )
- remove ( )
- getTreeLock ( )
- setDoubleBuffered ( )
- setDefaultLocale ( )
- getLayout ( )
- requestFocus ( )
- WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
- getAutoscrolls ( )
- getToolTipLocation ( )
Related Classes
- java.io.File
- java.util.logging.Level
- java.awt.image.BufferedImage
- java.awt.Color
- java.awt.event.ActionEvent
- java.awt.event.ActionListener
- javax.swing.JPanel
- java.awt.Dimension
- javax.swing.JFrame
- java.awt.Font
- java.awt.event.MouseEvent
- javax.swing.JLabel
- java.awt.Graphics2D
- java.awt.Graphics
- javax.swing.JButton
- java.awt.event.KeyEvent
- java.awt.BorderLayout
- java.awt.Component
- javax.swing.JScrollPane
- java.awt.event.WindowEvent
- java.awt.Rectangle
- javax.swing.JTextField
- javax.swing.SwingUtilities
- java.awt.event.MouseAdapter
- javax.swing.ImageIcon
Java Code Examples for javax.swing.JComponent#requestFocus()
The following examples show how to use
javax.swing.JComponent#requestFocus() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QuietEditorPane.java From netbeans with Apache License 2.0 | 6 votes |
private void requestFocus(JComponent comp) { Container container = SwingUtilities.getAncestorOfClass(TopComponent.class, comp); if (container != null) { ((TopComponent)container).requestActive(); } else { Component f = comp; do { f = f.getParent(); if (f instanceof Frame) { break; } } while (f != null); if (f != null) { f.requestFocus(); } comp.requestFocus(); } }
Example 2
Source File: IOWindow.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void requestActive() { super.requestActive(); JComponent tab = getSelectedTab(); if (tab != null) { tab.requestFocus(); } }
Example 3
Source File: TerminalContainerCommon.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void requestFocus() { // redirect focus into terminal JComponent selected = getSelected(); if (selected != null) { selected.requestFocus(); } else { super.requestFocus(); } }
Example 4
Source File: StringTableCellEditor.java From netbeans with Apache License 2.0 | 5 votes |
@Override public Component getTableCellEditorComponent(final JTable table, Object value, boolean isSelected, final int row, final int column) { final JComponent c = (JComponent) super.getTableCellEditorComponent(table, value, isSelected, row, column); this.tableModel = table.getModel(); this.columnName = table.getColumnName(column); this.modelRow = table.convertRowIndexToModel(row); this.modelColumn = table.convertColumnIndexToModel(column); this.tc = c instanceof JTextComponent ? (JTextComponent) c : null; JPanel panel = new JPanel(new BorderLayout()) { @Override public void addNotify() { super.addNotify(); c.requestFocus(); } }; panel.add(c); if (suppressEditorBorder) { c.setBorder(BorderFactory.createEmptyBorder()); } panel.add(customEditorButton, BorderLayout.EAST); panel.revalidate(); panel.repaint(); return panel; }
Example 5
Source File: SwingUtilities2.java From Bytecoder with Apache License 2.0 | 4 votes |
/** * Request focus on the given component if it doesn't already have it * and {@code isRequestFocusEnabled()} returns true. */ public static void adjustFocus(JComponent c) { if (!c.hasFocus() && c.isRequestFocusEnabled()) { c.requestFocus(); } }