All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.awt.Component
|
+----gjt.ImageButton
ImageButtons have two constructors, both of which take an Image, along with a default constructor. The Image passed to a constructor must not be null; this is enforced by assertions.
Using the default constructor creates an image button with no image specified. This is to allow flexibility when creating image buttons, but it should be noted that it's the developer's * responsibility to call setImage(Image) before the image button is painted, or an assertion will be thrown. Default border thickness is 2 pixels - thickness may be set at construction time only.
Event handling is delegated to an ImageButtonListener. By default, all ImageButtons are fitted with an instance of SpringyImageButtonListener, however, setListener(ImageButtonListener) may be used to fit an ImageButton with a different derivation of ImageButtonListener after construction.
ImageButtons ensure that their Images are completely loaded before they are displayed.
Drawn either raised or inset, current state may be queried via the isRaised() method.
setEnabled(false) disables response to input and repaints the image with a black and white version. setEnabled(true) restores the original image and enables response to input.
public ImageButton()
public ImageButton(Image image)
public ImageButton(Image image,
int thickness)
public ImageButton(Image image,
int thickness,
ImageButtonListener listener)
public static void setDefaultThickness(int defThickness)
public static int getDefaultThickness()
public void setBubbleHelp(String bubbleText)
public void setBubbleInterval(long interval)
public long getBubbleInterval()
public void activate()
public void arm()
public void disarm()
public void setThickness(int thickness)
public void setArmed(boolean armed)
public boolean isArmed()
public void setImage(Image image)
public ImageButtonListener getListener()
public void setListener(ImageButtonListener l)
public Dimension minimumSize()
public Dimension getMinimumSize()
public Dimension preferredSize()
public Dimension getPreferredSize()
public boolean isRaised()
public void setRaised()
public boolean isInset()
public void setInset()
public boolean isDisabled()
public void enable()
public void disable()
public void setEnabled(boolean enable)
public void resize(int w,
int h)
public void setSize(int w,
int h)
public void reshape(int x,
int y,
int w,
int h)
public void setBounds(int x,
int y,
int w,
int h)
public void paint(Graphics g)
public void paintInset()
public void paintRaised()
public void processActionEvent()
public synchronized void addActionListener(ActionListener listener)
public synchronized void removeActionListener(ActionListener listener)
All Packages Class Hierarchy This Package Previous Next Index