Package swing.combobox

Source Code of swing.combobox.ComboBox

/*
* ComboBox.java
*
* Created on 2009. oktober 22., 10:17
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package swing.combobox;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JComboBox;

/**
*
* @author laci
*/
public class ComboBox extends JComboBox {
 
// <editor-fold defaultstate="collapsed" desc="Konstansok">
 
  public static final int DEFAULT_COLUMN_SIZE = 10;
 
// </editor-fold>
 
// <editor-fold defaultstate="collapsed" desc="Konstruktor">
  /** Creates a new instance of ComboBox */
  public ComboBox() {
    super();
    initialize();
  }
 
// </editor-fold>
 
// <editor-fold defaultstate="collapsed" desc="Inicializ�l�s">
 
  public void initialize() {
    addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_F8) {
          ComboBox.this.setSelectedIndex(-1);
        }
        if (e.getKeyCode() == KeyEvent.VK_ENTER) {
          ComboBox.this.transferFocus();
        }
      }
     
      public void keyReleased(KeyEvent e) {
       
      }
     
      public void keyTyped(KeyEvent e) {
       
      }
    });
  }
 
// </editor-fold>
 
}
TOP

Related Classes of swing.combobox.ComboBox

TOP
Copyright © 2018 www.massapi.com. 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.