Java Code Examples for javax.swing.JComponent#setFocusable()

The following examples show how to use javax.swing.JComponent#setFocusable() . 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: PaletteUI.java    From pumpernickel with MIT License 6 votes vote down vote up
@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 File: ToolbarToggleButton.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
@Override
public JComponent createCustomComponent(Presentation presentation) {
    final JComponent customComponent = super.createCustomComponent(presentation);
    customComponent.setFocusable(false);
    customComponent.setOpaque(false);
    return customComponent;
}
 
Example 3
Source File: RightAngleBoxContainerPanelUI.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
public void installUI(JComponent c) {
	super.installUI(c);
	c.setFocusable(true);
	c.addKeyListener(keyListener);
}
 
Example 4
Source File: InfoPanel.java    From WorldGrower with GNU General Public License v3.0 4 votes vote down vote up
private void makeUnfocussable(JComponent component) {
	component.setRequestFocusEnabled(false);
	component.setFocusable(false);
}