Package java.awt.event

Examples of java.awt.event.KeyAdapter


    mExpandListenerIsEnabled = false;
    expand(mRootNode);
    mExpandListenerIsEnabled = true;

    addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if(e.getKeyCode() == KeyEvent.VK_DELETE) {
          if(getSelectionPath() != null) {
            FavoriteNode node = (FavoriteNode)getSelectionPath().getLastPathComponent();
            FavoriteNode parent = (FavoriteNode)node.getParent();
View Full Code Here


        }
        disableSync  = false;
      }
    });

    mList.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if(e.getKeyCode() == KeyEvent.VK_SPACE) {
          showChannel();
        }
      }
View Full Code Here

          // Ignore
        }
      }
    });

    mText.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_ENTER) {
          startSearch();
        }
      }
View Full Code Here

      }
    });

    // use INSERT key on left side to move selected channels to active channel
    // list
    mAllChannels.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_INSERT) {
          moveChannelsToRight();
        }
      }
    });

    // use DELETE key on right side to remove selected channels
    mSubscribedChannels.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_DELETE) {
          moveChannelsToLeft();
        }
      }
View Full Code Here

                public void mouseClicked(MouseEvent evt) {
                    openScript(tree.getSelectionPath());
                }
            });
            // track enter key
            tree.addKeyListener(new KeyAdapter() {
                public void keyPressed(KeyEvent evt) {
                    if (evt.getKeyCode() == KeyEvent.VK_ENTER)
                        openScript(tree.getSelectionPath());
                }
            });
            JScrollPane treeScroller = new JScrollPane(tree);
            treeScroller.setPreferredSize(new Dimension(180, 300));

            list = new JList();
            // no bold font lists for me, thanks
            list.setFont(list.getFont().deriveFont(Font.PLAIN));
            list.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent evt) {
                    openFunction((FunctionItem) list.getSelectedValue());
                }
            });
            list.addKeyListener(new KeyAdapter() {
                public void keyPressed(KeyEvent evt) {
                    if (evt.getKeyCode() == KeyEvent.VK_ENTER)
                        openFunction((FunctionItem) list.getSelectedValue());
                }
            });
View Full Code Here

    addMouseAdapter(mFindNext);
    addMouseAdapter(mFindPrev);
    addMouseAdapter(mSearchCloseBtn);

    searchField.addKeyListener(new KeyAdapter() {
      public void keyReleased(KeyEvent e) {
        mFindNext.setEnabled(searchField.getText().length() > 0);
        mFindPrev.setEnabled(searchField.getText().length() > 0);
      }
    });
View Full Code Here

    comp.registerKeyboardAction(this, KeyStroke.getKeyStroke('I', InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
        JComponent.WHEN_FOCUSED);
  }
 
  public void installKeyListener(Component comp) {
    comp.addKeyListener(new KeyAdapter() {

      public void keyTyped(KeyEvent e) {
        if (Character.isLetterOrDigit(e.getKeyChar()) &&
            !(e.isControlDown()||e.isMetaDown())) {
          actionPerformed(new ActionEvent(this, 0, "show"));
View Full Code Here

        if (e.getPropertyName().equals("model")) {
          model = (ComboBoxModel) e.getNewValue();
        }
      }
    });
    editorKeyListener = new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent e) {
        if (comboBox.isDisplayable()) {
          comboBox.setPopupVisible(true);
        }
View Full Code Here

            }
          }
        }
      }
    });
    mList.addKeyListener(new KeyAdapter(){
      public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_SPACE) {
          Object[] objs = mList.getSelectedValues();
          for (Object obj : objs) {
            if (obj instanceof SelectableItem) {
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        soundTestBt.setEnabled(mSoundFileChB.isSelected());
      }
    });
   
    mSoundFileChB.getTextField().addKeyListener(new KeyAdapter() {
      public void keyReleased(KeyEvent e) {
        String text = mSoundFileChB.getTextField().getText();
        if((new File(text)).isFile()) {
          boolean notFound = true;
          for (String extension : extArr) {
View Full Code Here

TOP

Related Classes of java.awt.event.KeyAdapter

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.