1 33 34 package edu.rice.cs.drjava.ui.config; 35 36 import javax.swing.*; 37 import edu.rice.cs.drjava.config.*; 38 import edu.rice.cs.drjava.*; 39 import java.awt.*; 40 import java.awt.event.*; 41 42 43 46 public class ButtonComponent extends OptionComponent<Object > { 47 protected JButton _jb; 48 49 55 public ButtonComponent(ActionListener l, String text, Frame parent) { 56 super(null, "", parent); 57 _jb = new JButton(text); 58 _jb.addActionListener(l); 59 _jb.addActionListener(new ActionListener() { 60 public void actionPerformed(ActionEvent e) { notifyChangeListeners(); } 61 }); 62 } 63 64 71 public ButtonComponent(ActionListener l, String text, Frame parent, String description) { 72 this(l, text, parent); 73 setDescription(description); 74 } 75 76 80 public void setDescription(String description) { 81 _jb.setToolTipText(description); 82 _label.setToolTipText(description); 83 } 84 85 89 public boolean updateConfig() { 90 return true; 92 } 93 94 97 public void setValue(Object value) { 98 } 100 101 104 public JComponent getComponent() { return _jb; } 105 } 106 | Popular Tags |