< prev index next >

## src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java

Print this page

    *** 34,43 ****
    --- 34,44 ----
      import javax.swing.plaf.*;
      import javax.swing.text.View;

      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;
    + import java.awt.event.InputEvent;
      import java.awt.event.KeyEvent;
      import java.awt.Component;
      import java.awt.Container;
      import java.awt.Dimension;
      import java.awt.Rectangle;
    *** 400,409 ****
    --- 401,413 ----
                      SwingUtilities.replaceUIInputMap(l,
                                      JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
                  }
                  inputMap.clear();
                  inputMap.put(KeyStroke.getKeyStroke(dka, BasicLookAndFeel.getFocusAcceleratorKeyMask(), false), "press");
    +             inputMap.put(KeyStroke.getKeyStroke(dka,
    +                     BasicLookAndFeel.getFocusAcceleratorKeyMask() |
    +                             InputEvent.ALT_GRAPH_DOWN_MASK, false), "press");
              }
              else {
                  InputMap inputMap = SwingUtilities.getUIInputMap
                                  (l, JComponent.WHEN_IN_FOCUSED_WINDOW);
                  if (inputMap != null) {
    *** 518,527 ****
    --- 522,534 ----
                          SwingUtilities.replaceUIInputMap(label, JComponent.WHEN_FOCUSED, inputMap);
                      }
                      int dka = label.getDisplayedMnemonic();
                      putOnRelease(inputMap, dka, BasicLookAndFeel
                              .getFocusAcceleratorKeyMask());
    +                 putOnRelease(inputMap, dka, BasicLookAndFeel
    +                         .getFocusAcceleratorKeyMask() |
    +                         InputEvent.ALT_GRAPH_DOWN_MASK);
                      // Need this when the sticky keys are enabled
                      putOnRelease(inputMap, dka, 0);
                      // Need this if ALT is released before the accelerator
                      putOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                      label.requestFocus();
    *** 537,546 ****
    --- 544,556 ----
                          if (inputMap != null) {
                              // inputMap should never be null.
                              int dka = label.getDisplayedMnemonic();
                              removeOnRelease(inputMap, dka, BasicLookAndFeel
                                      .getFocusAcceleratorKeyMask());
    +                         removeOnRelease(inputMap, dka, BasicLookAndFeel
    +                                 .getFocusAcceleratorKeyMask() |
    +                                 InputEvent.ALT_GRAPH_DOWN_MASK);
                              removeOnRelease(inputMap, dka, 0);
                              removeOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                          }
                          inputMap = SwingUtilities.getUIInputMap(label,
                                  JComponent.WHEN_IN_FOCUSED_WINDOW);
    *** 553,562 ****
    --- 563,575 ----
                          if (isCommand) {
                              putOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                          } else {
                              putOnRelease(inputMap, dka, BasicLookAndFeel
                                      .getFocusAcceleratorKeyMask());
    +                         putOnRelease(inputMap, dka, BasicLookAndFeel
    +                                 .getFocusAcceleratorKeyMask() |
    +                                 InputEvent.ALT_GRAPH_DOWN_MASK);
                              // Need this when the sticky keys are enabled
                              putOnRelease(inputMap, dka, 0);
                          }
                          if (labelFor instanceof Container &&
                                  ((Container) labelFor).isFocusCycleRoot()) {
    *** 570,579 ****
    --- 583,595 ----
                          int dka = label.getDisplayedMnemonic();
                          if (inputMap != null) {
                              if (isCommand) {
                                  removeOnRelease(inputMap, dka, BasicLookAndFeel
                                          .getFocusAcceleratorKeyMask());
    +                             removeOnRelease(inputMap, dka, BasicLookAndFeel
    +                                     .getFocusAcceleratorKeyMask() |
    +                                     InputEvent.ALT_GRAPH_DOWN_MASK);
                                  removeOnRelease(inputMap, dka, 0);
                              } else {
                                  removeOnRelease(inputMap, KeyEvent.VK_ALT, 0);
                              }
                          }

< prev index next >