public class QButton extends JButton
JButton.AccessibleJButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
FOCUS_AROUND_ICON
focus rectangle around icon
|
static int |
FOCUS_AROUND_TEXT
focus rectangle around text
|
static int |
FOCUS_AROUND_TEXT_AND_ICON
focus rectangle around icon and text
|
static int |
FOCUS_NONE
Do not have a focus rectangle
|
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
QButton()
Constructor without a set text or icon.
|
QButton(Action a)
Constructor with properties take from the action supplied.
|
QButton(Icon icon)
Constructor for a button with an Icon.
|
QButton(String text)
Constructor for a button with text.
|
QButton(String text,
Icon icon)
Constructor for a button with an icon and text.
|
Modifier and Type | Method and Description |
---|---|
Color |
getDisabledBackground()
Returns the background color that is painted when the button is disabled.
|
Border |
getDisabledBorder()
Returns the border that is painted when the button is disabled.
|
Font |
getDisabledFont()
Returns the font that is painted when the button is disabled.
|
Color |
getDisabledForeground()
Returns the foreground color that is painted when the button is disabled.
|
Color |
getDisabledSelectedBackground()
Returns the background color that is painted when the button is disabledSelected.
|
Border |
getDisabledSelectedBorder()
Returns the border that is painted when the button is disabledSelected.
|
Font |
getDisabledSelectedFont()
Returns the font that is painted when the button is disabledSelected.
|
Color |
getDisabledSelectedForeground()
Returns the foreground color that is painted when the button is disabledSelected.
|
Color |
getFocusedBackground()
Returns the background color that is painted when the button is focused.
|
Border |
getFocusedBorder()
Returns the border that is painted when the button is focused.
|
Font |
getFocusedFont()
Returns the font that is painted when the button is focused.
|
Color |
getFocusedForeground()
Returns the foreground color that is painted when the button is focused.
|
Icon |
getFocusedIcon()
Returns the icon that is painted when the button is focused.
|
Color |
getFocusedRectangleColor()
Returns the color for the rectangle that is painted when the button is
in focus.
|
int |
getFocusedRectangleMode()
Returns the mode for the rectangle that is painted when the button is
in focus.
|
Color |
getFocusedSelectedBackground()
Returns the background color that is painted when the button is focusedSelected.
|
Border |
getFocusedSelectedBorder()
Returns the border that is painted when the button is focusedSelected.
|
Font |
getFocusedSelectedFont()
Returns the font that is painted when the button is focusedSelected.
|
Color |
getFocusedSelectedForeground()
Returns the foreground color that is painted when the button is focusedSelected.
|
Icon |
getFocusedSelectedIcon()
Returns the icon that is painted when the button is focusedSelected.
|
int |
getMaximumLines()
Get the maximum number of lines used for the button text.
|
int |
getMinimumLines()
Get the minimum number of lines used for the button text.
|
Color |
getPressedBackground()
Returns the background color that is painted when the button is pressed.
|
Border |
getPressedBorder()
Returns the border that is painted when the button is pressed.
|
Font |
getPressedFont()
Returns the font that is painted when the button is pressed.
|
Color |
getPressedForeground()
Returns the foreground color that is painted when the button is pressed.
|
Color |
getRolloverBackground()
Returns the background color that is painted when the button is rollover.
|
Border |
getRolloverBorder()
Returns the border that is painted when the button is rollover.
|
Font |
getRolloverFont()
Returns the font that is painted when the button is rollover.
|
Color |
getRolloverForeground()
Returns the foreground color that is painted when the button is rollover.
|
Color |
getRolloverSelectedBackground()
Returns the background color that is painted when the button is rolloverSelected.
|
Border |
getRolloverSelectedBorder()
Returns the border that is painted when the button is rolloverSelected.
|
Font |
getRolloverSelectedFont()
Returns the font that is painted when the button is rolloverSelected.
|
Color |
getRolloverSelectedForeground()
Returns the foreground color that is painted when the button is rolloverSelected.
|
Color |
getSelectedBackground()
Returns the background color that is painted when the button is selected.
|
Border |
getSelectedBorder()
Returns the border that is painted when the button is selected.
|
Font |
getSelectedFont()
Returns the font that is painted when the button is selected.
|
Color |
getSelectedForeground()
Returns the foreground color that is painted when the button is selected.
|
boolean |
isDoubleClick()
Call to find out if the double click has been enabled.
|
protected void |
paintBorder(Graphics g)
Paints the QButton's border, this border needs to be selected from all
component state specific borders.
|
void |
setDisabledBackground(Color color)
Sets the background color that is painted when the button is disabled.
|
void |
setDisabledBorder(Border border)
Sets the border that is painted when the button is disabled.
|
void |
setDisabledFont(Font font)
Sets the Font that is painted when the button is disabled.
|
void |
setDisabledForeground(Color color)
Sets the foreground color that is painted when the button is disabled.
|
void |
setDisabledSelectedBackground(Color color)
Sets the background color that is painted when the button is disabledSelected.
|
void |
setDisabledSelectedBorder(Border border)
Sets the border that is painted when the button is disabledSelected.
|
void |
setDisabledSelectedFont(Font font)
Sets the Font that is painted when the button is disabledSelected.
|
void |
setDisabledSelectedForeground(Color color)
Sets the foreground color that is painted when the button is disabledSelected.
|
void |
setDoubleClick(boolean enable)
Enables the double click, this makes the button no longer returning an
action event when the button has been clicked, only when double clicked.
|
void |
setFocusedBackground(Color color)
Sets the background color that is painted when the button is focused.
|
void |
setFocusedBorder(Border border)
Sets the border that is painted when the button is focused.
|
void |
setFocusedFont(Font font)
Sets the Font that is painted when the button is focused.
|
void |
setFocusedForeground(Color color)
Sets the foreground color that is painted when the button is focused.
|
void |
setFocusedIcon(Icon icon)
Sets the Icon that is painted when the button is focused.
|
void |
setFocusedRectangleColor(Color color)
Sets the color for the rectangle that is painted when the button is
in focus.
|
void |
setFocusedRectangleMode(int mode)
Sets the mode for the rectangle that is painted when the button is
in focus.
|
void |
setFocusedSelectedBackground(Color color)
Sets the background color that is painted when the button is focusedSelected.
|
void |
setFocusedSelectedBorder(Border border)
Sets the border that is painted when the button is focusedSelected.
|
void |
setFocusedSelectedFont(Font font)
Sets the Font that is painted when the button is focusedSelected.
|
void |
setFocusedSelectedForeground(Color color)
Sets the foreground color that is painted when the button is focusedSelected.
|
void |
setFocusedSelectedIcon(Icon icon)
Sets the Icon that is painted when the button is focusedSelected.
|
void |
setLines(int lines)
Set the number of lines used for the button text.
|
void |
setMaximumLines(int lines)
Sets the maximum number of possible lines on this button.
|
void |
setMinimumLines(int lines)
Sets the minimum number of possible lines on this button.
|
void |
setPressedBackground(Color color)
Sets the background color that is painted when the button is pressed.
|
void |
setPressedBorder(Border border)
Sets the border that is painted when the button is pressed.
|
void |
setPressedFont(Font font)
Sets the Font that is painted when the button is pressed.
|
void |
setPressedForeground(Color color)
Sets the foreground color that is painted when the button is pressed.
|
void |
setRolloverBackground(Color color)
Sets the background color that is painted when the button is rollover.
|
void |
setRolloverBorder(Border border)
Sets the border that is painted when the button is rollover.
|
void |
setRolloverFont(Font font)
Sets the Font that is painted when the button is rollover.
|
void |
setRolloverForeground(Color color)
Sets the foreground color that is painted when the button is rollover.
|
void |
setRolloverSelectedBackground(Color color)
Sets the background color that is painted when the button is rolloverSelected.
|
void |
setRolloverSelectedBorder(Border border)
Sets the border that is painted when the button is rolloverSelected.
|
void |
setRolloverSelectedFont(Font font)
Sets the Font that is painted when the button is rolloverSelected.
|
void |
setRolloverSelectedForeground(Color color)
Sets the foreground color that is painted when the button is rolloverSelected.
|
void |
setSelectedBackground(Color color)
Sets the background color that is painted when the button is selected.
|
void |
setSelectedBorder(Border border)
Sets the border that is painted when the button is selected.
|
void |
setSelectedFont(Font font)
Sets the Font that is painted when the button is selected.
|
void |
setSelectedForeground(Color color)
Sets the foreground color that is painted when the button is selected.
|
void |
updateUI()
Sets the look and feel to the Bounce Button UI look and feel.
|
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int FOCUS_NONE
public static final int FOCUS_AROUND_TEXT
public static final int FOCUS_AROUND_ICON
public static final int FOCUS_AROUND_TEXT_AND_ICON
public QButton()
public QButton(Action a)
a
- the associated action.public QButton(Icon icon)
icon
- the icon for the button.public QButton(String text)
text
- the text for the button.public void updateUI()
protected void paintBorder(Graphics g)
paintBorder
in class AbstractButton
g
- the graphics.public void setPressedBackground(Color color)
color
- the pressed background color.public Color getPressedBackground()
public void setPressedForeground(Color color)
color
- the pressed foreground color.public Color getPressedForeground()
public void setPressedBorder(Border border)
border
- the pressed border.public Border getPressedBorder()
public void setPressedFont(Font font)
font
- the pressed font.public Font getPressedFont()
public void setSelectedBackground(Color color)
color
- the selected background color.public Color getSelectedBackground()
public void setSelectedForeground(Color color)
color
- the selected foreground color.public Color getSelectedForeground()
public void setSelectedBorder(Border border)
border
- the selected border.public Border getSelectedBorder()
public void setSelectedFont(Font font)
font
- the selected font.public Font getSelectedFont()
public void setDisabledBackground(Color color)
color
- the disabled background color.public Color getDisabledBackground()
public void setDisabledForeground(Color color)
color
- the disabled foreground color.public Color getDisabledForeground()
public void setDisabledBorder(Border border)
border
- the disabled border.public Border getDisabledBorder()
public void setDisabledFont(Font font)
font
- the disabled font.public Font getDisabledFont()
public void setDisabledSelectedBackground(Color color)
color
- the disabledSelected background color.public Color getDisabledSelectedBackground()
public void setDisabledSelectedForeground(Color color)
color
- the disabledSelected foreground color.public Color getDisabledSelectedForeground()
public void setDisabledSelectedBorder(Border border)
border
- the disabledSelected border.public Border getDisabledSelectedBorder()
public void setDisabledSelectedFont(Font font)
font
- the disabledSelected font.public Font getDisabledSelectedFont()
public void setRolloverBackground(Color color)
color
- the rollover background color.public Color getRolloverBackground()
public void setRolloverForeground(Color color)
color
- the rollover foreground color.public Color getRolloverForeground()
public void setRolloverBorder(Border border)
border
- the rollover border.public Border getRolloverBorder()
public void setRolloverFont(Font font)
font
- the rollover font.public Font getRolloverFont()
public void setRolloverSelectedBackground(Color color)
color
- the rolloverSelected background color.public Color getRolloverSelectedBackground()
public void setRolloverSelectedForeground(Color color)
color
- the rolloverSelected foreground color.public Color getRolloverSelectedForeground()
public void setRolloverSelectedBorder(Border border)
border
- the rolloverSelected border.public Border getRolloverSelectedBorder()
public void setRolloverSelectedFont(Font font)
font
- the rolloverSelected font.public Font getRolloverSelectedFont()
public void setFocusedBackground(Color color)
color
- the focused background color.public Color getFocusedBackground()
public void setFocusedForeground(Color color)
color
- the focused foreground color.public Color getFocusedForeground()
public void setFocusedBorder(Border border)
border
- the focused border.public Border getFocusedBorder()
public void setFocusedFont(Font font)
font
- the focused font.public Font getFocusedFont()
public Icon getFocusedIcon()
public void setFocusedIcon(Icon icon)
icon
- the focused icon.public void setFocusedSelectedBackground(Color color)
color
- the focusedSelected background color.public Color getFocusedSelectedBackground()
public void setFocusedSelectedForeground(Color color)
color
- the focusedSelected foreground color.public Color getFocusedSelectedForeground()
public void setFocusedSelectedBorder(Border border)
border
- the focusedSelected border.public Border getFocusedSelectedBorder()
public void setFocusedSelectedFont(Font font)
font
- the focusedSelected font.public Font getFocusedSelectedFont()
public Icon getFocusedSelectedIcon()
public void setFocusedSelectedIcon(Icon icon)
icon
- the focusedSelected icon.public void setFocusedRectangleColor(Color color)
color
- the focused Rectangle color.public Color getFocusedRectangleColor()
public void setFocusedRectangleMode(int mode)
mode
- the focused mode.public int getFocusedRectangleMode()
public void setDoubleClick(boolean enable)
enable
- the double click value, the value is enabled when true.public boolean isDoubleClick()
public void setMaximumLines(int lines)
lines
- the number of lines.IllegalArgumentException
- if lines
is smaller than the minimum number of lines.public int getMaximumLines()
public void setMinimumLines(int lines)
lines
- the number of lines.IllegalArgumentException
- if lines
is bigger than the maximum number of lines.public int getMinimumLines()
public void setLines(int lines)
lines
- the number of lines.Copyright © 2002-2013 Edwin Dankert. All Rights Reserved.