javax.swing
クラス JButton
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.AbstractButton
|
+--javax.swing.JButton
- すべての実装インタフェース:
- Accessible, ImageObserver, ItemSelectable, MenuContainer, Serializable, SwingConstants
- 直系の既知のサブクラス:
- BasicArrowButton, MetalComboBoxButton
- public class JButton
- extends AbstractButton
- implements Accessible
「プッシュ」ボタンの実装です。ボタンの情報および使用例については、「The Java Tutorial」の「How to Use Buttons, Check Boxes, and Radio Buttons」を参照してください。
標準の Look & Feel (L&F) 表現でこのコンポーネントが使用するキーボードのキーについては、JButton のキーの割り当てを参照してください。
警告:
このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
- 関連項目:
- 直列化された形式
クラス javax.swing.AbstractButton から継承したフィールド |
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 |
インタフェース javax.swing.SwingConstants から継承したフィールド |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
クラス javax.swing.AbstractButton から継承したメソッド |
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isFocusTraversable, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setEnabled, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition |
クラス javax.swing.JComponent から継承したメソッド |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
クラス java.awt.Container から継承したメソッド |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
クラス java.awt.Component から継承したメソッド |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
JButton
public JButton()
- テキストおよびアイコンなしのボタンを作成します。
JButton
public JButton(Icon icon)
- アイコン付きのボタンを作成します。
- パラメータ:
icon
- ボタン上に表示するアイコンイメージ
JButton
public JButton(String text)
- テキスト付きのボタンを作成します。
- パラメータ:
text
- ボタンのテキスト
JButton
public JButton(Action a)
- 指定された Action からプロパティを取得してボタンを作成します。
- 導入されたバージョン:
- 1.3
JButton
public JButton(String text,
Icon icon)
- 初期テキストおよびアイコン付きのボタンを作成します。
- パラメータ:
text
- ボタンのテキストicon
- ボタン上に表示するアイコンイメージ
updateUI
public void updateUI()
- L&F が変更されたことを示す UIFactory からの通知です。
- オーバーライド:
- クラス
AbstractButton
内の updateUI
- 関連項目:
JComponent.updateUI()
getUIClassID
public String getUIClassID()
- このコンポーネントを描画する L&F クラスの名前を文字列で返します。
- オーバーライド:
- クラス
JComponent
内の getUIClassID
- 戻り値:
- ButtonUI
- 関連項目:
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
isDefaultButton
public boolean isDefaultButton()
- ボタンが RootPane のデフォルトボタンかどうかを判定します。
- 戻り値:
- boolean 値
- 関連項目:
JRootPane.setDefaultButton(javax.swing.JButton)
isDefaultCapable
public boolean isDefaultCapable()
- ボタンが RootPane のデフォルトボタンになることができるかどうかを判定します。
- 戻り値:
- boolean 値
- 関連項目:
setDefaultCapable(boolean)
,
isDefaultButton()
,
JRootPane.setDefaultButton(javax.swing.JButton)
setDefaultCapable
public void setDefaultCapable(boolean defaultCapable)
- ボタンが RootPane のデフォルトボタンになることができるかどうかを設定します。
- 戻り値:
- boolean 値
- 関連項目:
isDefaultCapable()
removeNotify
public void removeNotify()
- このボタンが現在 RootPane のデフォルトボタンとして設定されているかどうかを確認するために
JComponent.removeNotify
をオーバーライドします。設定されている場合、RootPane のデフォルトボタンを null に設定し RootPane で無効なボタンを参照させないようにします。
- オーバーライド:
- クラス
JComponent
内の removeNotify
- クラス
javax.swing.JComponent
からコピーされたタグ:
- 関連項目:
JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)
configurePropertiesFromAction
protected void configurePropertiesFromAction(Action a)
- Action インスタンスの値に従って AbstractButton のプロパティを設定するファクトリメソッドです。設定されるプロパティは AbstractButton サブクラスにより異なります。デフォルトでは、設定されるプロパティは、Text、Icon、Enabled、および ToolTipText です。
- オーバーライド:
- クラス
AbstractButton
内の configurePropertiesFromAction
- パラメータ:
a
- プロパティを取得する Action、または null- 導入されたバージョン:
- 1.3
- 関連項目:
Action
,
AbstractButton.setAction(javax.swing.Action)
paramString
protected String paramString()
- この JButton の文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、
null
にはなりません。
- オーバーライド:
- クラス
AbstractButton
内の paramString
- 戻り値:
- この JButton の文字列表現
getAccessibleContext
public AccessibleContext getAccessibleContext()
- この JButton に関連した AccessibleContext を返します。JButton の場合、AccessibleContext は AccessibleJButton の形式を取ります。必要に応じて新規の AccessibleJButton インスタンスが作成されます。
- 定義:
- インタフェース
Accessible
内の getAccessibleContext
- オーバーライド:
- クラス
JComponent
内の getAccessibleContext
- 戻り値:
- この JButton の AccessibleContext として機能する AccessibleJButton
バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。 Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.