All Packages Class Hierarchy This Package Previous Next Index

Class org.jfouffa.components.JButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----org.jfouffa.components.JButton

public class JButton
extends Component
This class is a button text string.


Variable index

 o CENTER
the center alignment for the text.
 o LEFT
the left alignment for the text.
 o RIGHT
the right alignment for the text.

Constructor index

 o JButton(String)
Constructs a new JButton Component.
 o JButton(String, boolean)
Constructs a new JButton Component.
 o JButton(String, int, int, boolean)
Constructs a new JButton Component.
 o JButton(String, int, int, int, int, boolean)
Constructs a new JButton Component.

Method index

 o getAlignment()
Gets the text alignment.
 o getMinimumSize()
Returns the minimum size of this component.
 o getPreferredSize()
Returns the preferred size of this component.
 o paint(Graphics)
Paints the component.
 o setAlignment(int)
Sets the text alignment to the specified alignment.
 o toString()
Returns the String representation of this Component's values.

Variables

 o RIGHT
 public static final int RIGHT
the right alignment for the text.

 o CENTER
 public static final int CENTER
the center alignment for the text.

 o LEFT
 public static final int LEFT
the left alignment for the text.

Constructors

 o JButton
 public JButton(String name)
Constructs a new JButton Component.

Parameters:
name - the icon name
 o JButton
 public JButton(String name,
                boolean alwaysBorder)
Constructs a new JButton Component.

Parameters:
name - the icon name
alwaysBorder - if true, JButton will always paints its border
 o JButton
 public JButton(String name,
                int x,
                int y,
                boolean alwaysBorder)
Constructs a new JButton Component.

Parameters:
name - the icon name
x - the x coordinate
y - the y coordinate
alwaysBorder - if true, JButton will always paints its border
 o JButton
 public JButton(String name,
                int x,
                int y,
                int hgap,
                int vgap,
                boolean alwaysBorder)
Constructs a new JButton Component.

Parameters:
name - the icon name
x - the x coordinate
y - the y coordinate
hgap - horizontal text spacing
vgap - vertical text spacing
alwaysBorder - if true, JButton will always paints its border

Methods

 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size of this component.

Overrides:
getMinimumSize in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size of this component.

Overrides:
getPreferredSize in class Component
 o getAlignment
 public int getAlignment()
Gets the text alignment.

 o setAlignment
 public void setAlignment(int alignment)
Sets the text alignment to the specified alignment.

Parameters:
alignment - the new text alignment
 o paint
 public void paint(Graphics g)
Paints the component.

Parameters:
g - the specified Graphics window
Overrides:
paint in class Component
 o toString
 public String toString()
Returns the String representation of this Component's values.

Overrides:
toString in class Component