All Packages Class Hierarchy This Package Previous Next Index
Class ca.bc.europa.awt.ImageButton
java.lang.Object
|
+----java.awt.Component
|
+----ca.bc.europa.awt.ImageButton
- public class ImageButton
- extends Component
- implements Runnable
The ImageButton
class loads an image and makes
a button out of it.
Up to three images are created from the original image, with the
use of three ImageFilters. The three images are used to represent
the three button states, mouse over, pressed, and released (default).
For a nice button effect try the Buttonize filter. The Bright filter
can be used to create a good mouse over effect.
An example input image:
- See Also:
- Component, Runnable
-
ImageButton(Image, int, int)
- Create and ImageButton.
-
ImageButton(Image, int, int, ImageFilter, ImageFilter, ImageFilter)
- Create and ImageButton.
-
ImageButton(URL, int, int)
- Create and ImageButton.
-
ImageButton(URL, int, int, ImageFilter, ImageFilter, ImageFilter)
- Create and ImageButton.
-
getPreferredSize()
- Get the preferred size for the component.
-
paint(Graphics)
- Draw the component.
-
run()
- Retrieve and filter all image varients for the button.
-
setImage(Image)
- Set a new image for the button.
-
update(Graphics)
- Update the component.
ImageButton
public ImageButton(URL imageURL,
int w,
int h,
ImageFilter inFilter,
ImageFilter outFilter,
ImageFilter moFilter)
- Create and ImageButton.
- Parameters:
- imageURL - A URL to an image that will be used as a basis for
the button.
- w - The width of the component, no image resize takes place.
- h - The height of the component, no image resize takes place.
- inFilter - An image filter used to create the pressed button look.
- outFilter - An image filter used to create the relased button look.
- moFilter - An image filter used to create a mouse over image.
ImageButton
public ImageButton(URL imageURL,
int w,
int h)
- Create and ImageButton.
- Parameters:
- imageURL - A URL to an image that will be used as a basis for
the button.
- w - The width of the component, no image resize takes place.
- h - The height of the component, no image resize takes place.
ImageButton
public ImageButton(Image image,
int w,
int h,
ImageFilter inFilter,
ImageFilter outFilter,
ImageFilter moFilter)
- Create and ImageButton.
- Parameters:
- image - An image that will be used as a basis for the button.
- w - The width of the component, no image resize takes place.
- h - The height of the component, no image resize takes place.
- inFilter - An image filter used to create the pressed button look.
- outFilter - An image filter used to create the relased button look.
- moFilter - An image filter used to create a mouse over image.
ImageButton
public ImageButton(Image image,
int w,
int h)
- Create and ImageButton.
- Parameters:
- image - An image that will be used as a basis for the button.
- w - The width of the component, no image resize takes place.
- h - The height of the component, no image resize takes place.
setImage
public void setImage(Image image)
- Set a new image for the button.
- Parameters:
- image - The new image.
getPreferredSize
public Dimension getPreferredSize()
- Get the preferred size for the component.
Required for exact initial size.
- Overrides:
- getPreferredSize in class Component
- See Also:
- Component
update
public void update(Graphics g)
- Update the component.
- Parameters:
- g - the Graphics context.
- Overrides:
- update in class Component
- See Also:
- Component
paint
public void paint(Graphics g)
- Draw the component.
- Parameters:
- g - the Graphics context.
- Overrides:
- paint in class Component
- See Also:
- Component
run
public synchronized void run()
- Retrieve and filter all image varients for the button.
All Packages Class Hierarchy This Package Previous Next Index