Up: Java Kali Home Page

Class ImageButton

Class ImageButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ImageButton

class ImageButton
extends Canvas
An ImageButton is a custom GUI widget which is a button with an image on it. (The AWT does not have such a widget, presumably because it's not very portable, but I find that this works fine.)

Constructor Index

 o ImageButton(Image, Image, ImageButtonGroup)
Create a new button with the given images and group, and initially in its "false" (up) state.
 o ImageButton(Image, Image, ImageButtonGroup, boolean)
Create a new button with the given images, group, and initial state.

Method Index

 o getState()
Return the state (true corresponds to down) of the button.
 o minimumSize()
 o mouseDown(Event, int, int)
 o mouseEnter(Event, int, int)
 o mouseExit(Event, int, int)
 o mouseUp(Event, int, int)
 o paint(Graphics)
 o preferredSize()
 o setState(boolean)
Set the state of the button.
 o setStateInternal(boolean)

Constructors

 o ImageButton
  public ImageButton(Image upImage,
                     Image downImage,
                     ImageButtonGroup group,
                     boolean state)
Create a new button with the given images, group, and initial state.
 o ImageButton
  public ImageButton(Image upImage,
                     Image downImage,
                     ImageButtonGroup group)
Create a new button with the given images and group, and initially in its "false" (up) state.

Methods

 o preferredSize
  public Dimension preferredSize()
Overrides:
preferredSize in class Component
 o minimumSize
  public Dimension minimumSize()
Overrides:
minimumSize in class Component
 o paint
  public void paint(Graphics g)
Overrides:
paint in class Canvas
 o getState
  public boolean getState()
Return the state (true corresponds to down) of the button.
 o setState
  public void setState(boolean state)
Set the state of the button. True corresponds to down.
 o setStateInternal
  public void setStateInternal(boolean state)
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
Overrides:
mouseDown in class Component
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
Overrides:
mouseUp in class Component
 o mouseEnter
  public boolean mouseEnter(Event evt,
                            int x,
                            int y)
Overrides:
mouseEnter in class Component
 o mouseExit
  public boolean mouseExit(Event evt,
                           int x,
                           int y)
Overrides:
mouseExit in class Component


Up: Java Kali Home Page

[HOME] The Geometry Center Home Page

Author: Mark Phillips
Comments to: webmaster@geom.umn.edu
Created: Sep 16 1996 --- Last modified: Sep 18 1996