mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE fix in mnemonics painting
(cherry picked from commit c7e3ebbc83a19a22a3039e17906aafd65ca6e573)
This commit is contained in:
@@ -458,13 +458,15 @@ public class DarculaLaf extends BasicLookAndFeel {
|
||||
private static void repaintMnemonics(@NotNull Component focusOwner, boolean pressed) {
|
||||
if (pressed != myAltPressed) return;
|
||||
Window window = SwingUtilities.windowForComponent(focusOwner);
|
||||
for (Component component : window.getComponents()) {
|
||||
if (component instanceof JComponent) {
|
||||
for (JComponent c : UIUtil.findComponentsOfType((JComponent)component, JComponent.class)) {
|
||||
if ((c instanceof JLabel && ((JLabel)c).getDisplayedMnemonicIndex() != -1)
|
||||
|| (c instanceof AbstractButton && ((AbstractButton)c).getDisplayedMnemonicIndex() != -1)
|
||||
) {
|
||||
c.repaint();
|
||||
if (window != null) {
|
||||
for (Component component : window.getComponents()) {
|
||||
if (component instanceof JComponent) {
|
||||
for (JComponent c : UIUtil.findComponentsOfType((JComponent)component, JComponent.class)) {
|
||||
if ((c instanceof JLabel && ((JLabel)c).getDisplayedMnemonicIndex() != -1)
|
||||
|| (c instanceof AbstractButton && ((AbstractButton)c).getDisplayedMnemonicIndex() != -1)
|
||||
) {
|
||||
c.repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user