public class PJSpinButton extends JComponent implements ActionListener, KeyListener, FocusListener, DocumentListener, MouseWheelListener
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
PJSpinButton(PControl owner,
int columns,
String originalString,
int masterIndex,
PPanel panel,
boolean hasBorder,
double scaleButtonWidth)
Creates a new visual SpinButton, with the specified number of columns.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
Handles
ActionEvent generated by the timer. |
void |
addKeyListener(KeyListener kl)
Remap add key listener to the actual entry field.
|
void |
changedUpdate(DocumentEvent e)
The entry field item has changed.
|
void |
doLayout()
Lays out the SpinButton with all its subcomponents.
|
void |
focusGained(FocusEvent e)
Focus gained message: from FocusListener interface.
|
void |
focusLost(FocusEvent e)
Focus lost message: from FocusListener interface.
|
Color |
getBackground() |
Font |
getFont()
Gets the font used in the text field.
|
Color |
getForeground() |
Dimension |
getMinimumSize() |
Dimension |
getPreferredSize() |
PJEntryField |
getTextField()
Gets a handle to the text field.
|
void |
grabFocus()
Override grab focus and try to set focus to text area.
|
void |
insertUpdate(DocumentEvent e)
The entry field item is changed due to an insertion of text.
|
boolean |
isFocusTraversable()
This component handles focus, so return true.
|
void |
itemStateChanged(ItemEvent e)
Notifies that a combobox list item have been selected.
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
void |
mouseWheelMoved(MouseWheelEvent e)
Mouse wheel support.
|
void |
removeNotify()
Make sure timer is killed.
|
void |
removeUpdate(DocumentEvent e)
The entry field item is changed due to text removal.
|
void |
requestFocus()
Override request focus and try to set focus to text area.
|
void |
setBackground(Color c) |
void |
setEnabled(boolean isEnabled)
Set JtextField enable/disable and set enabled to text area.
|
void |
setFont(Font font)
Sets the font for the text field.
|
void |
setForeground(Color c) |
void |
setHorizontalAlignment(int alignment)
Sets the horizontal alignment in the text field.
|
void |
setToolTipText(String s)
Sets the tool-tip text entry field and spin buttons.
|
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, transferFocusUpCyclepublic PJSpinButton(PControl owner, int columns, String originalString, int masterIndex, PPanel panel, boolean hasBorder, double scaleButtonWidth)
public void addKeyListener(KeyListener kl)
addKeyListener in class Componentpublic PJEntryField getTextField()
public void setHorizontalAlignment(int alignment)
alignment - The new alignment.public void setFont(Font font)
setFont in class JComponentfont - The new font to be used in the text field.public Font getFont()
getFont in interface MenuContainergetFont in class Componentpublic void setForeground(Color c)
setForeground in class JComponentpublic void setBackground(Color c)
setBackground in class JComponentpublic Color getForeground()
getForeground in class Componentpublic Color getBackground()
getBackground in class Componentpublic Dimension getPreferredSize()
getPreferredSize in class JComponentpublic Dimension getMinimumSize()
getMinimumSize in class JComponentpublic void doLayout()
public void removeNotify()
removeNotify in class JComponentpublic void actionPerformed(ActionEvent e)
ActionEvent generated by the timer.actionPerformed in interface ActionListenere - The ActionEvent from the timer.public void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyTyped(KeyEvent e)
keyTyped in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved in interface MouseWheelListenerpublic void focusLost(FocusEvent e)
focusLost in interface FocusListenerpublic void focusGained(FocusEvent e)
focusGained in interface FocusListenerpublic void setEnabled(boolean isEnabled)
setEnabled in class JComponentpublic void grabFocus()
grabFocus in class JComponentpublic void requestFocus()
requestFocus in class JComponentpublic boolean isFocusTraversable()
isFocusTraversable in class Componentpublic void setToolTipText(String s)
setToolTipText in class JComponentpublic void itemStateChanged(ItemEvent e)
public void changedUpdate(DocumentEvent e)
changedUpdate in interface DocumentListenerpublic void insertUpdate(DocumentEvent e)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent e)
removeUpdate in interface DocumentListenerPhantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.