ActionListener, MouseListener, MouseMotionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, SwingConstantspublic class JSplitButton extends JButton implements MouseMotionListener, MouseListener, ActionListener, Serializable
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListenerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyContainer.AccessibleAWTContainerJButton.AccessibleJButtonJComponent.AccessibleJComponent| 限定符和类型 | 字段 | 说明 |
|---|---|---|
protected SplitButtonActionListener |
splitButtonActionListener |
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_PROPERTYaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| 构造器 | 说明 |
|---|---|
JSplitButton() |
Creates a button with no set text or icon.
|
JSplitButton(String text) |
Creates a button with text.
|
JSplitButton(String text,
Icon icon) |
Creates a button with initial text and an icon.
|
JSplitButton(Icon icon) |
Creates a button with an icon.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
actionPerformed(ActionEvent e) |
|
void |
addSplitButtonActionListener(SplitButtonActionListener l) |
Adds an
SplitButtonActionListener to the button. |
Color |
getArrowColor() |
Gets the color of the arrow.
|
int |
getArrowSize() |
gets the size of the arrow.
|
Color |
getDisabledArrowColor() |
gets the disabled arrow color
|
Image |
getImage() |
Gets the image to be drawn in the split part.
|
JPopupMenu |
getPopupMenu() |
Returns the JPopupMenu if set, null otherwise.
|
int |
getSeparatorSpacing() |
Returns the separatorSpacing.
|
int |
getSplitWidth() |
Splitwidth is the width of the split part of the button.
|
boolean |
isAlwaysDropDown() |
Show the dropdown menu, if attached, even if the button part is clicked.
|
void |
mouseClicked(MouseEvent e) |
|
void |
mouseDragged(MouseEvent e) |
|
void |
mouseEntered(MouseEvent e) |
|
void |
mouseExited(MouseEvent e) |
|
void |
mouseMoved(MouseEvent e) |
|
void |
mousePressed(MouseEvent e) |
|
void |
mouseReleased(MouseEvent e) |
|
protected void |
paintComponent(Graphics g) |
|
void |
removeSplitButtonActionListener(SplitButtonActionListener l) |
Removes an
SplitButtonActionListener from the button. |
void |
setAlwaysDropDown(boolean alwaysDropDown) |
Show the dropdown menu, if attached, even if the button part is clicked.
|
void |
setArrowColor(Color arrowColor) |
Set the arrow color.
|
void |
setArrowSize(int arrowSize) |
sets the size of the arrow
|
void |
setDisabledArrowColor(Color disabledArrowColor) |
sets the disabled arrow color
|
void |
setImage(Image image) |
Sets the image to draw instead of the triangle.
|
void |
setPopupMenu(JPopupMenu popupMenu) |
Sets the JPopupMenu to be displayed, when the split part of the button is
clicked.
|
void |
setSeparatorSpacing(int separatorSpacing) |
Sets the separatorSpacing.Separator spacing is the space above and below
the separator( the line drawn when you hover your mouse over the split
part of the button).
|
void |
setSplitWidth(int splitWidth) |
Splitwidth is the width of the split part of the button.
|
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, paintBorder, 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, setVerticalTextPositionaction, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, 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, validateTreegetAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUIaddAncestorListener, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, 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, updateprotected SplitButtonActionListener splitButtonActionListener
public JSplitButton(String text, Icon icon)
text - the text of the buttonicon - the Icon image to display on the buttonpublic JSplitButton(String text)
text - the text of the buttonpublic JSplitButton(Icon icon)
icon - the Icon image to display on the buttonpublic JSplitButton()
public JPopupMenu getPopupMenu()
public void setPopupMenu(JPopupMenu popupMenu)
popupMenu - public int getSeparatorSpacing()
public void setSeparatorSpacing(int separatorSpacing)
separatorSpacing - public boolean isAlwaysDropDown()
public void setAlwaysDropDown(boolean alwaysDropDown)
alwaysDropDown - true to show the attached dropdown even if the
button part is clicked, false otherwisepublic Color getArrowColor()
public void setArrowColor(Color arrowColor)
arrowColor - public Color getDisabledArrowColor()
public void setDisabledArrowColor(Color disabledArrowColor)
disabledArrowColor - color of the arrow if no popup attached.public int getSplitWidth()
public void setSplitWidth(int splitWidth)
splitWidth - public int getArrowSize()
public void setArrowSize(int arrowSize)
arrowSize - public Image getImage()
public void setImage(Image image)
image - protected void paintComponent(Graphics g)
paintComponent 在类中 JComponentg - public void addSplitButtonActionListener(SplitButtonActionListener l)
SplitButtonActionListener to the button.l - the ActionListener to be addedpublic void removeSplitButtonActionListener(SplitButtonActionListener l)
SplitButtonActionListener from the button. If the
listener is the currently set Action for the button, then
the Action is set to null.l - the listener to be removedpublic void mouseMoved(MouseEvent e)
mouseMoved 在接口中 MouseMotionListenere - public void actionPerformed(ActionEvent e)
actionPerformed 在接口中 ActionListenere - public void mouseExited(MouseEvent e)
mouseExited 在接口中 MouseListenere - public void mouseDragged(MouseEvent e)
mouseDragged 在接口中 MouseMotionListenerpublic void mouseClicked(MouseEvent e)
mouseClicked 在接口中 MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed 在接口中 MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased 在接口中 MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered 在接口中 MouseListenerCopyright © 2019. All rights reserved.