Package java.awt.event

Examples of java.awt.event.KeyAdapter


    itemVector.add("Item 8");
    itemList.setListData(itemVector);
    itemList.setBackground(Color.decode("#cccccc"));
    itemList.setBorder(BorderFactory.createEmptyBorder(0,10,0,10));
   
    itemList.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if ((e.getKeyCode() == KeyEvent.VK_SPACE) || (e.getKeyCode() == KeyEvent.VK_ENTER)) {
          String internalFrameName = (String) itemList.getSelectedValue();
          JInternalFrame internalFrame = (JInternalFrame) internalFrameMap.get(internalFrameName);
          menuSelectionManager.clearSelectedPath();
View Full Code Here


        }
        setModel(model);

        addMouseListener(mouseAdapter);

        addKeyListener(new KeyAdapter() {
            @Override
            public void keyTyped(KeyEvent e) {
                if (e.getKeyChar() == ' ') {
                    int[] indices = CheckBoxList.this.getSelectedIndices();
                    for (int index : indices) {
View Full Code Here

    okButton = new JButton("Ok");
    cancelButton = new JButton("Cancel");

    super.dialogInit();

    KeyListener keyListener = (new KeyAdapter() {
      public void keyPressed(KeyEvent e){
        if (e.getKeyCode() == KeyEvent.VK_ESCAPE ||
            (e.getSource() == cancelButton
            && e.getKeyCode() == KeyEvent.VK_ENTER)){
          pressed_OK = false;
View Full Code Here

        updateUIWithFindModel();
        //new CloseOnESCAction(this, table);
        new PrevOccurrenceAction(this, table, false);
        new NextOccurrenceAction(this, table, false);
        searchableComponent.getTable().addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                if (!e.isConsumed()) {
                    int keyChar = e.getKeyChar();
                    if (keyChar == 27) { // ESCAPE
View Full Code Here

        if (e.isPopupTrigger()) {
          headerPopup.show(e.getComponent(), e.getX(), e.getY());
        }
      }
    });
    addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent keyEvent) {
        if (keyEvent.getKeyCode() == KeyEvent.VK_DELETE && keyEvent.isControlDown()) {
          System.err.println(".keyPressed()");
          keyEvent.consume();
View Full Code Here

    keyLabel.setText("Key Listener");
    modelLabel.setText("Model");
    focusLabel.setText("Focus Listener");
    inputLabel.setText("Input Verifier");

    keyText.addKeyListener(new KeyAdapter() {
      public void keyTyped(KeyEvent e) {
        char c = e.getKeyChar();
        if (!(Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE))) {
          getToolkit().beep();
          e.consume();
View Full Code Here

    JComboBox combo= new JComboBox();
    combo.setEditable(true);
    combo.setLightWeightPopupEnabled(false);

    combo.getEditor().getEditorComponent().addKeyListener(
      new KeyAdapter() {
        public void keyTyped(KeyEvent e) {
          textChanged();
          if (e.getKeyChar() == KeyEvent.VK_ENTER)
            runSuite();
        }
View Full Code Here

                public void actionPerformed(java.awt.event.ActionEvent e) {
                    phoneTextActionPerformed(e);
                }
            });

            addPhoneUserPanel.addNameTextKeyReleasedListener(new KeyAdapter() {

                @Override
                public void keyReleased(java.awt.event.KeyEvent e) {
                    setEnabledActionButton();
                }
            });
            addPhoneUserPanel.addPhoneTextKeyReleasedListener(new KeyAdapter() {

                @Override
                public void keyReleased(java.awt.event.KeyEvent e) {
                    setEnabledActionButton();
                }
View Full Code Here

    public AboutDialog(Frame owner){
        super(owner);
        buildGUI();

        addKeyListener(new KeyAdapter(){
                public void keyPressed(KeyEvent e){
                    if(e.getKeyCode() == KeyEvent.VK_ESCAPE){
                        setVisible(false);
                        dispose();
                    }
View Full Code Here

                    returnCode = CANCEL_OPTION;
                    dispose();
                }
            });

        addKeyListener(new KeyAdapter(){
                public void keyPressed(KeyEvent e){
                    if(e.getKeyCode() == KeyEvent.VK_ESCAPE){
                        setVisible(false);
                        returnCode = CANCEL_OPTION;
                        dispose();
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.