Package javax.swing.plaf

Examples of javax.swing.plaf.ComponentInputMapUIResource


            comp.setFont(UIManager.getFont(fontName));
        }
    }

    public static ComponentInputMap makeComponentInputMap(final JComponent comp, final Object[] keys) {
        ComponentInputMapUIResource result = new ComponentInputMapUIResource(comp);
        loadKeyBindings(result, keys);

        return result;
    }
View Full Code Here


        if (needToAdd) {
            if (needToRemove && wasInputMap) {
                im.remove(KeyStroke.getKeyStroke(lastFocusAccelerator,
                                                 InputEvent.ALT_DOWN_MASK));
            } else if (!wasInputMap) {
                im = new ComponentInputMapUIResource(component);
                im.put(KeyStroke.getKeyStroke(accelerator,
                                              InputEvent.ALT_DOWN_MASK),
                       FOCUS_ACTION_NAME);
                if (!wasInputMap) {
                    SwingUtilities.replaceUIInputMap(component,
View Full Code Here

            // add a keystroke for the given mnemonic mapping to 'press';
            InputMap keyMap = SwingUtilities.getUIInputMap(l,
                                 JComponent.WHEN_IN_FOCUSED_WINDOW);
            if (keyMap == null)
              {
                keyMap = new ComponentInputMapUIResource(l);
                SwingUtilities.replaceUIInputMap(l,
                    JComponent.WHEN_IN_FOCUSED_WINDOW, keyMap);
              }
            else
              {
View Full Code Here

        if(m != 0) {
            InputMap map = SwingUtilities.getUIInputMap(
                                b, JComponent.WHEN_IN_FOCUSED_WINDOW);

            if (map == null) {
                map = new ComponentInputMapUIResource(b);
                SwingUtilities.replaceUIInputMap(b,
                               JComponent.WHEN_IN_FOCUSED_WINDOW, map);
            }
            map.clear();
            map.put(KeyStroke.getKeyStroke(m, InputEvent.ALT_MASK, false),
View Full Code Here

  InputMap createInputMap(int condition)
  {
    if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW)
    {
      return new ComponentInputMapUIResource(menuItem);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of javax.swing.plaf.ComponentInputMapUIResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.