home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicComboBoxEditor.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.6 KB  |  54 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Component;
  4. import java.awt.event.ActionListener;
  5. import java.awt.event.FocusEvent;
  6. import java.awt.event.FocusListener;
  7. import javax.swing.ComboBoxEditor;
  8. import javax.swing.JTextField;
  9. import javax.swing.border.Border;
  10.  
  11. public class BasicComboBoxEditor implements ComboBoxEditor, FocusListener {
  12.    protected JTextField editor = new BorderlessTextField("", 9);
  13.  
  14.    public BasicComboBoxEditor() {
  15.       this.editor.setBorder((Border)null);
  16.    }
  17.  
  18.    public void addActionListener(ActionListener var1) {
  19.       this.editor.addActionListener(var1);
  20.    }
  21.  
  22.    public void focusGained(FocusEvent var1) {
  23.    }
  24.  
  25.    public void focusLost(FocusEvent var1) {
  26.    }
  27.  
  28.    public Component getEditorComponent() {
  29.       return this.editor;
  30.    }
  31.  
  32.    public Object getItem() {
  33.       return this.editor.getText();
  34.    }
  35.  
  36.    public void removeActionListener(ActionListener var1) {
  37.       this.editor.removeActionListener(var1);
  38.    }
  39.  
  40.    public void selectAll() {
  41.       this.editor.selectAll();
  42.       this.editor.requestFocus();
  43.    }
  44.  
  45.    public void setItem(Object var1) {
  46.       if (var1 != null) {
  47.          this.editor.setText(var1.toString());
  48.       } else {
  49.          this.editor.setText("");
  50.       }
  51.  
  52.    }
  53. }
  54.