I have a JPanel suite with Windows Look and Feel. I have 3 JCheckBoxes, including 2 disconnected ones that do not interfere with this problem. However, a non-disabled failure with JButton, which I later in this JPanel:
JCheckBox Code:
JCheckBox checkBox = new JCheckBox("TTxJIRA Bash"); checkBox.setSize(300, (checkBox.getFontMetrics(checkBox.getFont()).getHeight())); checkBox.setLocation(10, 100); checkBox.setVisible(true); checkBox.setSelected(true); checkBox.setBackground(new Color(0, 0, 0, 0)); checkBox.setFocusable(false); add(checkBox);
And the JButton code:
JButton button = new JButton("Install"); button.setSize(80, 25); button.setLocation(getWidth() - 100, getHeight() - 60); button.setFocusable(false); button.setVisible(true); add(button);
When I hover over a button, hover over this check box, this will happen:

My wild assumption makes me think that this is due to the simultaneous focusing of the two components, but adding button.setFocusable(false); did not help.
java swing jbutton jcheckbox
Momo
source share