Java プラットフォーム 1.2

javax.swing
クラス JCheckBox

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.AbstractButton
                          |
                          +--javax.swing.JToggleButton
                                |
                                +--javax.swing.JCheckBox

public class JCheckBox
extends JToggleButton
implements Accessible

CheckBox の実装です。チェックボックスとは、選択または選択解除できる項目であり、その状態をユーザに表示します。チェックボックスのグループでは、複数のチェックボックスを選択できます。 詳細は、「The Java Tutorial」「How to Use CheckBoxes」を参照してください。

標準の Look & Feel (L&F) 表現でこのコンポーネントが使用するキーボードのキーについては、JCheckBox のキーの割り当てを参照してください。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
JRadioButton, 直列化された形式

内部クラスの概要
protected  class JCheckBox.AccessibleJCheckBox
          オブジェクトのユーザ補助機能を取得するために使用されるクラスです。
 
クラス javax.swing.JToggleButton から継承した内部クラス
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel
 
クラス javax.swing.AbstractButton から継承した内部クラス
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
クラス javax.swing.JComponent から継承した内部クラス
JComponent.AccessibleJComponent
 
クラス 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.JComponent から継承したフィールド
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
クラス java.awt.Component から継承したフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
コンストラクタの概要
JCheckBox()
          初期状態で選択されていない、テキストおよびアイコンなしのチェックボックスボタンを作成します。
JCheckBox(Icon icon)
          初期状態で選択されていない、アイコン付きのチェックボックスを作成します。
JCheckBox(Icon icon, boolean selected)
          アイコン付きのチェックボックスを作成し、それが初期状態で選択されているかどうかを指定します。
JCheckBox(String text)
          初期状態で選択されていない、テキスト付きのチェックボックスを作成します。
JCheckBox(String text, boolean selected)
          テキスト付きのチェックボックスを作成し、それが初期状態で選択されているかどうかを指定します。
JCheckBox(String text, Icon icon)
          初期状態で選択されていない、指定されたテキストおよびアイコン付きのチェックボックスを作成します。
JCheckBox(String text, Icon icon, boolean selected)
          テキストおよびアイコン付きのチェックボックスを作成し、それが初期状態で選択されているかどうかを指定します。
 
メソッドの概要
 AccessibleContext getAccessibleContext()
          JComponent に関連付けられている AccessibleContext を取得します。
 String getUIClassID()
          このコンポーネントを描画する L&F クラスの名前を示す文字列を返します。
protected  String paramString()
          この JCheckBox の文字列表現を返します。
 void updateUI()
          L&F が変更されたことを示す UIFactory からの通知です。
 
クラス javax.swing.AbstractButton から継承したメソッド
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, 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, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, 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, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, 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, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

JCheckBox

public JCheckBox()
初期状態で選択されていない、テキストおよびアイコンなしのチェックボックスボタンを作成します。

JCheckBox

public JCheckBox(Icon icon)
初期状態で選択されていない、アイコン付きのチェックボックスを作成します。
パラメータ:
icon - 表示するアイコンイメージ

JCheckBox

public JCheckBox(Icon icon,
                 boolean selected)
アイコン付きのチェックボックスを作成し、それが初期状態で選択されているかどうかを指定します。
パラメータ:
icon - 表示するアイコンイメージ
selected - 初期選択状態を示す boolean 値。true の場合、チェックボックスは選択される

JCheckBox

public JCheckBox(String text)
初期状態で選択されていない、テキスト付きのチェックボックスを作成します。
パラメータ:
text - チェックボックスのテキスト

JCheckBox

public JCheckBox(String text,
                 boolean selected)
テキスト付きのチェックボックスを作成し、それが初期状態で選択されているかどうかを指定します。
パラメータ:
text - チェックボックスのテキスト
selected - 初期選択状態を示す boolean 値。true の場合、チェックボックスは選択される

JCheckBox

public JCheckBox(String text,
                 Icon icon)
初期状態で選択されていない、指定されたテキストおよびアイコン付きのチェックボックスを作成します。
パラメータ:
text - チェックボックスのテキスト
icon - 表示するアイコンイメージ

JCheckBox

public JCheckBox(String text,
                 Icon icon,
                 boolean selected)
テキストおよびアイコン付きのチェックボックスを作成し、それが初期状態で選択されているかどうかを指定します。
パラメータ:
text - チェックボックスのテキスト
icon - 表示するアイコンイメージ
selected - 初期選択状態を示す boolean 値。true の場合、チェックボックスは選択される
メソッドの詳細

updateUI

public void updateUI()
L&F が変更されたことを示す UIFactory からの通知です。
オーバーライド:
クラス JToggleButton 内の updateUI
関連項目:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
このコンポーネントを描画する L&F クラスの名前を示す文字列を返します。
戻り値:
"CheckBoxUI"
オーバーライド:
クラス JToggleButton 内の getUIClassID
関連項目:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

paramString

protected String paramString()
この JCheckBox の文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、null にはなりません。

JFC コンポーネントの新しい側面についての情報を返すには、paramString() をオーバーライドします。

戻り値:
この JCheckBox の文字列表現
オーバーライド:
クラス JToggleButton 内の paramString

getAccessibleContext

public AccessibleContext getAccessibleContext()
JComponent に関連付けられている AccessibleContext を取得します。
定義:
インタフェース Accessible 内の getAccessibleContext
戻り値:
JComponent の AccessibleContext
オーバーライド:
クラス JToggleButton 内の getAccessibleContext

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.