Java Code Examples for javax.swing.JComponent#setFocusable()
The following examples show how to use
javax.swing.JComponent#setFocusable() .
These examples are extracted from open source projects.
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 Project: pumpernickel File: PaletteUI.java License: MIT License | 6 votes |
@Override public void installUI(JComponent c) { super.installUI(c); c.addPropertyChangeListener(JPalette.PROPERTY_COLORS, propertyLayoutListener); c.addPropertyChangeListener(PaletteUI.PROPERTY_HIGHLIGHT, propertyRepaintListener); c.setLayout(new PaletteLayoutManager()); c.setRequestFocusEnabled(true); c.addMouseListener(mouseListener); c.addFocusListener(focusListener); c.addKeyListener(keyListener); c.setFocusable(true); Fields fields = getFields((JPalette) c, true); fields.install(); c.setBorder(new CompoundBorder(new LineBorder(new Color(0xB0B0B0)), new FocusedBorder(getDefaultBorder()))); relayoutCells((JPalette) c); }
Example 2
Source Project: azure-devops-intellij File: ToolbarToggleButton.java License: MIT License | 5 votes |
@Override public JComponent createCustomComponent(Presentation presentation) { final JComponent customComponent = super.createCustomComponent(presentation); customComponent.setFocusable(false); customComponent.setOpaque(false); return customComponent; }
Example 3
Source Project: pumpernickel File: RightAngleBoxContainerPanelUI.java License: MIT License | 4 votes |
@Override public void installUI(JComponent c) { super.installUI(c); c.setFocusable(true); c.addKeyListener(keyListener); }
Example 4
Source Project: WorldGrower File: InfoPanel.java License: GNU General Public License v3.0 | 4 votes |
private void makeUnfocussable(JComponent component) { component.setRequestFocusEnabled(false); component.setFocusable(false); }