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
-
CENTER
- the center alignment for the text.
-
LEFT
- the left alignment for the text.
-
RIGHT
- the right alignment for the text.
Constructor index
-
JButton(String)
- Constructs a new JButton Component.
-
JButton(String, boolean)
- Constructs a new JButton Component.
-
JButton(String, int, int, boolean)
- Constructs a new JButton Component.
-
JButton(String, int, int, int, int, boolean)
- Constructs a new JButton Component.
Method index
-
getAlignment()
- Gets the text alignment.
-
getMinimumSize()
- Returns the minimum size of this component.
-
getPreferredSize()
- Returns the preferred size of this component.
-
paint(Graphics)
- Paints the component.
-
setAlignment(int)
- Sets the text alignment to the specified alignment.
-
toString()
- Returns the String representation of this Component's values.
Variables
RIGHT
public static final int RIGHT
- the right alignment for the text.
CENTER
public static final int CENTER
- the center alignment for the text.
LEFT
public static final int LEFT
- the left alignment for the text.
Constructors
JButton
public JButton(String name)
- Constructs a new JButton Component.
- Parameters:
- name - the icon name
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
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
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
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum size of this component.
- Overrides:
- getMinimumSize in class Component
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size of this component.
- Overrides:
- getPreferredSize in class Component
getAlignment
public int getAlignment()
- Gets the text alignment.
setAlignment
public void setAlignment(int alignment)
- Sets the text alignment to the specified alignment.
- Parameters:
- alignment - the new text alignment
paint
public void paint(Graphics g)
- Paints the component.
- Parameters:
- g - the specified Graphics window
- Overrides:
- paint in class Component
toString
public String toString()
- Returns the String representation of this Component's values.
- Overrides:
- toString in class Component