Methodsunit II Aj
Methodsunit II Aj
JFileChooser()
Constructs a JFileChooser pointing to the user's default directory.
JFileChooser(File currentDirectory)
Constructs a JFileChooser using the given File as the path.
JFileChooser(File currentDirectory, FileSystemView fsv)
Constructs a JFileChooser using the given current directory and FileSystemView.
JFileChooser(FileSystemView fsv)
Constructs a JFileChooser using the given FileSystemView.
JFileChooser(String currentDirectoryPath)
Constructs a JFileChooser using the given path.
JFileChooser(String currentDirectoryPath, FileSystemView fsv)
Constructs a JFileChooser using the given current directory path and FileSystemView.
Methods:
boolean accept(File f)
Returns true if the file should be displayed.
File getCurrentDirectory()
Returns the current directory.
String getDescription(File f)
Returns the file description.
int getFileSelectionMode()
Returns the current file-selection mode.
getIcon(File f)
Returns the icon for this file or type of file, depending on the system.
String getName(File f)
Returns the filename.
File getSelectedFile()
Returns the selected file.
File[] getSelectedFiles()
Returns a list of selected files if the file chooser is set to allow multiple selection.
String getTypeDescription(File f)
Returns the file type.
void setCurrentDirectory(File dir)
Sets the current directory.
void setDialogTitle(String dialogTitle)
Sets the string that goes in the JFileChooser window's title bar.
JInternalFrame()
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame
with no title.
JInternalFrame(String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame
with the specified title.
JInternalFrame(String title, boolean resizable)
Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the
specified title and resizability.
JInternalFrame(String title, boolean resizable, boolean closable)
Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title,
resizability, and closability.
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable)
Creates a non-iconifiable JInternalFrame with the specified title, resizability, closability,
and maximizability.
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable,
boolean iconifiable)
Creates a JInternalFrame with the specified title, resizability, closability, maximizability,
and iconifiability.
Methods
Container getContentPane()
Returns the content pane for this internal frame.
int getDefaultCloseOperation()
Returns the default operation that occurs when the user initiates a "close" on this
internal frame.
JInternalFrame.JDesktopIcon getDesktopIcon()
Returns the JDesktopIcon used when this JInternalFrame is iconified.
JDesktopPane getDesktopPane()
Convenience method that searches the ancestor hierarchy for a JDesktop instance.
Icon getFrameIcon()
Returns the image displayed in the title bar of this internal frame (usually in the top-left
corner).
String getTitle()
Returns the title of the JInternalFrame.
boolean isClosable()
Returns whether this JInternalFrame can be closed by some user action.
boolean isClosed()
Returns whether this JInternalFrame is currently closed.
boolean isFocusCycleRoot()
Always returns true because all JInternalFrames must be roots of a focus traversal
cycle.
boolean isIcon()
Returns whether the JInternalFrame is currently iconified.
boolean isIconifiable()
Gets the iconable property, which by default is false.
boolean isMaximizable()
Gets the value of the maximizable property.
boolean isMaximum()
Returns whether the JInternalFrame is currently maximized.
boolean isResizable()
Returns whether the JInternalFrame can be resized by some user action.
protected boolean isRootPaneCheckingEnabled()
Returns whether calls to add and setLayout are forwarded to the contentPane.
boolean isSelected()
Returns whether the JInternalFrame is the currently "selected" or active frame.
void reshape(int x, int y, int width, int height)
Moves and resizes this component.
void setClosable(boolean b)
Sets whether this JInternalFrame can be closed by some user action.
void setClosed(boolean b)
Closes this internal frame if the argument is true.
void setContentPane(Container c)
Sets this JInternalFrame's contentPane property.
void setDesktopIcon(JInternalFrame.JDesktopIcon d)
Sets the JDesktopIcon associated with this JInternalFrame.
void setFrameIcon(Icon icon)
Sets an image to be displayed in the titlebar of this internal frame (usually in the top-left
corner).
void setIcon(boolean b)
Iconifies or de-iconifies this internal frame, if the look and feel supports iconification.
void setIconifiable(boolean b)
Sets the iconable property, which must be true for the user to be able to make the
JInternalFrame an icon.
void setJMenuBar(JMenuBar m)
JMenuBar()
Creates a new menu bar.
Methods
JMenu add(JMenu c)
Appends the specified menu to the end of the menu bar.
JMenu getMenu(int index)
Returns the menu at the specified position in the menu bar.
int getMenuCount()
Returns the number of items in the menu bar.
boolean isBorderPainted()
Returns true if the menu bars border should be painted.
boolean isSelected()
Returns true if the menu bar currently has a component selected.
protected void paintBorder(Graphics g)
Paints the menubar's border if BorderPainted property is true.
void setBorderPainted(boolean b)
Sets whether the border should be painted.
void setSelected(Component sel)
Sets the currently selected component, producing a a change to the selection model.
JOptionPane()
Creates a JOptionPane with a test message.
JOptionPane(Object message)
Creates a instance of JOptionPane to display a message using the plain-message
message type and the default options delivered by the UI.
JOptionPane(Object message, int messageType)
Creates an instance of JOptionPane to display a message with the specified message
type and the default options,
JOptionPane(Object message, int messageType, int optionType)
Creates an instance of JOptionPane to display a message with the specified message
type and options.
JOptionPane(Object message, int messageType, int optionType, Icon icon)
Creates an instance of JOptionPane to display a message with the specified message
type, options, and icon.
JOptionPane(Object message, int messageType, int optionType, Icon icon,
Object[] options)
Creates an instance of JOptionPane to display a message with the specified message
type, icon, and options.
JOptionPane(Object message, int messageType, int optionType, Icon icon,
Object[] options, Object initialValue)
Creates an instance of JOptionPane to display a message with the specified message
type, icon, and options, with the initially-selected option specified.
Methods
Icon getIcon()
Returns the icon this pane displays.
Object getInitialSelectionValue()
Returns the input value that is displayed as initially selected to the user.
Object getInitialValue()
Returns the initial value.
Object getInputValue()
Returns the value the user has input, if wantsInput is true.
int getMaxCharactersPerLineCount()
Returns the maximum number of characters to place on a line in a message.
Object getMessage()
Returns the message-object this pane displays.
int getMessageType()
Returns the message type.
Object[] getOptions()
Returns the choices the user can make.
int getOptionType()
Returns the type of options that are displayed.
Object getValue()
Returns the value the user has selected.
void selectInitialValue()
Requests that the initial value be selected, which will set focus to the initial value.
void setIcon(Icon newIcon)
Sets the icon to display.
void setInitialSelectionValue(Object newValue)
Sets the input value that is initially displayed as selected to the user.
void setInitialValue(Object newInitialValue)
Sets the initial value that is to be enabled -- the Component that has the focus when the
pane is initially displayed.
void setInputValue(Object newValue)
Sets the input value that was selected or input by the user.
void setMessage(Object newMessage)
Sets the option pane's message-object.
void setMessageType(int newType)
Sets the option pane's message type.
void setOptions(Object[] newOptions)
Sets the options this pane displays.
void setOptionType(int newType)
Sets the options to display.
void setSelectionValues(Object[] newValues)
Sets the input selection values for a pane that provides the user with a list of items to
choose from.
static int showConfirmDialog(Component parentComponent, Object message)
Brings up a dialog with the options Yes, No and Cancel; with the title, Select an Option.
static int showConfirmDialog(Component parentComponent, Object message,
String title, int optionType)
Brings up a dialog where the number of choices is determined by the optionType
parameter.
static int showConfirmDialog(Component parentComponent, Object message,
String title, int optionType, int messageType)
Brings up a dialog where the number of choices is determined by the optionType
parameter, where the messageType parameter determines the icon to display.
static int showConfirmDialog(Component parentComponent, Object message,
String title, int optionType, int messageType, Icon icon)
Brings up a dialog with a specified icon, where the number of choices is determined by
the optionType parameter.
static String showInputDialog(Component parentComponent, Object message)
Shows a question-message dialog requesting input from the user parented to
parentComponent.
void moveToBack(Component c)
Moves the component to the bottom of the components in its current layer (position -1).
void moveToFront(Component c)
Moves the component to the top of the components in its current layer (position 0).
void paint(Graphics g)
Paints this JLayeredPane within the specified graphics context.
void remove(int index)
Remove the indexed component from this pane.
void removeAll()
Removes all the components from this container.
void setLayer(Component c, int layer)
Sets the layer attribute on the specified component, making it the bottommost
component in that layer.
void setLayer(Component c, int layer, int position)
Sets the layer attribute for the specified component and also sets its position within that
layer.
void setPosition(Component c, int position)
Moves the component to position within its current layer, where 0 is the topmost position
within the layer and -1 is the bottommost position.
JDesktopPane()
Creates a new JDesktopPane.
Methods:
JInternalFrame[] getAllFrames()
Returns all JInternalFrames currently displayed in the desktop.
JInternalFrame[] getAllFramesInLayer(int layer)
Returns all JInternalFrames currently displayed in the specified layer of the desktop.
int getDragMode()
Gets the current "dragging style" used by the desktop pane.
JInternalFrame getSelectedFrame()
Returns the currently active JInternalFrame in this JDesktopPane, or null if no
JInternalFrame is currently active.
void remove(int index)
Remove the indexed component from this pane.
void removeAll()
Removes all the components from this container.
JInternalFrame selectFrame(boolean forward)
Selects the next JInternalFrame in this desktop pane.
void setDragMode(int dragMode)
Sets the "dragging style" used by the desktop pane.
void setSelectedFrame(JInternalFrame f)
Sets the currently active JInternalFrame in this JDesktopPane.
JPanel()
Creates a new JPanel with a double buffer and a flow layout.
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
Methods:
JPopupMenu()
Constructs a JPopupMenu without an "invoker".
JPopupMenu(String label)
Constructs a JPopupMenu with the specified title.
Methods:
JMenuItem add(JMenuItem menuItem)
Appends the specified menu item to the end of this menu.
JMenuItem add(String s)
Creates a new menu item with the specified text and appends it to the end of this menu.
void addSeparator()
Appends a new separator at the end of the menu.
Component getComponent()
Returns this JPopupMenu component.
int getComponentIndex(Component c)
Returns the index of the specified component.
String getLabel()
Returns the popup menu's label
void insert(Action a, int index)
Inserts a menu item for the specified Action object at a given position.
void insert(Component component, int index)
Inserts the specified component into the menu at a given position.
boolean isBorderPainted()
Checks whether the border should be painted.
boolean isVisible()
Returns true if the popup menu is visible (currently being displayed).
void remove(int pos)
Removes the component at the specified index from this popup menu.
void setBorderPainted(boolean b)
Sets whether the border should be painted.
void setLabel(String label)
Sets the popup menu's label.
void setLocation(int x, int y)
Sets the location of the upper left corner of the popup menu using x, y coordinates.
void setPopupSize(Dimension d)
Sets the size of the Popup window using a Dimension object.
void setPopupSize(int width, int height)
Sets the size of the Popup window to the specified width and height.
void setSelected(Component sel)
Sets the currently selected component, This will result in a change to the selection
model.
void setVisible(boolean b)
Sets the visibility of the popup menu.
void show(Component invoker, int x, int y)
Displays the popup menu at the position x,y in the coordinate space of the component
invoker.
JProgressBar()
Creates a horizontal progress bar that displays a border but no progress string.
JProgressBar(int orient)
Creates a progress bar with the specified orientation, which can be either
SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
JProgressBar(int min, int max)
Creates a horizontal progress bar with the specified minimum and maximum.
JProgressBar(int orient, int min, int max)
Creates a progress bar using the specified orientation, minimum, and maximum.
Methods:
int getMaximum()
Returns the progress bar's maximum value from the BoundedRangeModel.
int getMinimum()
Returns the progress bar's minimum value from the BoundedRangeModel.
int getOrientation()
Returns SwingConstants.VERTICAL or SwingConstants.HORIZONTAL, depending on
the orientation of the progress bar.
String getString()
Returns a String representation of the current progress.
int getValue()
Returns the progress bar's current value from the BoundedRangeModel.
boolean isBorderPainted()
Returns the borderPainted property.
boolean isStringPainted()
Returns the value of the stringPainted property.
void setBorderPainted(boolean b)
Sets the borderPainted property, which is true if the progress bar should paint its border.
void setMaximum(int n)
Sets the progress bar's maximum value (stored in the progress bar's data model) to n.
void setMinimum(int n)
Sets the progress bar's minimum value (stored in the progress bar's data model) to n.
void setOrientation(int newOrientation)
Sets the progress bar's orientation to newOrientation, which must be
SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
void setString(String s)
Sets the value of the progress string.
void setValue(int n)
Sets the progress bar's current value to n.
JRootPane()
Creates a JRootPane, setting up its glassPane, layeredPane, and contentPane.
Methods:
Container getContentPane()
Returns the content pane -- the container that holds the components parented by the
root pane.
JButton getDefaultButton()
Returns the value of the defaultButton property.
protected Container createContentPane()
Called by the constructor methods to create the default contentPane.
protected Component createGlassPane()
Called by the constructor methods to create the default glassPane.
protected JLayeredPane createLayeredPane()
Called by the constructor methods to create the default layeredPane.
protected LayoutManager createRootLayout()
Called by the constructor methods to create the default layoutManager.
Container getContentPane()
Returns the content pane -- the container that holds the components parented by the
root pane.
JButton getDefaultButton()
Returns the value of the defaultButton property.
Component getGlassPane()
Returns the current glass pane for this JRootPane.
JMenuBar getJMenuBar()
Returns the menu bar from the layered pane.
JLayeredPane getLayeredPane()
Gets the layered pane used by the root pane.
void setContentPane(Container content)
Sets the content pane -- the container that holds the components parented by the root
pane.
void setDefaultButton(JButton defaultButton)
Sets the defaultButton property, which determines the current default button for this
JRootPane.
void setDoubleBuffered(boolean aFlag)
Sets whether this component should use a buffer to paint.
void setGlassPane(Component glass)
Sets a specified Component to be the glass pane for this root pane.
void setJMenuBar(JMenuBar menu)
Adds or changes the menu bar used in the layered pane.
void setLayeredPane(JLayeredPane layered)
Sets the layered pane for the root pane.
JScrollBar()
Creates a vertical scrollbar with the following initial values:
JScrollBar(int orientation)
Creates a scrollbar with the specified orientation and the following initial values:
JScrollBar(int orientation, int value, int extent, int min, int max)
Creates a scrollbar with the specified orientation, value, extent, minimum, and
maximum.
Methods:
int getMaximum()
The maximum value of the scrollbar is maximum - extent.
Dimension getMaximumSize()
The scrollbar is flexible along it's scrolling axis and rigid along the other axis.
int getMinimum()
Returns the minimum value supported by the scrollbar (usually zero).
Dimension getMinimumSize()
The scrollbar is flexible along it's scrolling axis and rigid along the other axis.
int getOrientation()
Returns the component's orientation (horizontal or vertical).
int getUnitIncrement()
For backwards compatibility with java.awt.Scrollbar.
int getUnitIncrement(int direction)
Returns the amount to change the scrollbar's value by, given a unit up/down request.
int getValue()
Returns the scrollbar's value.
boolean getValueIsAdjusting()
True if the scrollbar knob is being dragged.
int getVisibleAmount()
Returns the scrollbar's extent, aka its "visibleAmount".
void setBlockIncrement(int blockIncrement)
Sets the blockIncrement property.
void setEnabled(boolean x)
Component getRightComponent()
Returns the component to the right (or below) the divider.
Component getTopComponent()
Returns the component above, or to the left of the divider.
void remove(Component component)
Removes the child component, component from the pane.
void remove(int index)
Removes the Component at the specified index.
void removeAll()
Removes all the child components from the split pane.
void setBottomComponent(Component comp)
Sets the component below, or to the right of the divider.
void setLeftComponent(Component comp)
Sets the component to the left (or above) the divider.
void setOrientation(int orientation)
Sets the orientation, or how the splitter is divided.
void setTopComponent(Component comp)
Sets the component above, or to the left of the divider.
JTabbedPane()
Creates an empty TabbedPane with a default tab placement of JTabbedPane.TOP.
JTabbedPane(int tabPlacement)
Creates an empty TabbedPane with the specified tab placement of either:
JTabbedPane.TOP, JTabbedPane.BOTTOM, JTabbedPane.LEFT, or
JTabbedPane.RIGHT.
JTabbedPane(int tabPlacement, int tabLayoutPolicy)
Creates an empty TabbedPane with the specified tab placement and tab layout policy.
Methods:
Component add(Component component)
Adds a component with a tab title defaulting to the name of the component which is the
result of calling component.getName.
Component add(Component component, int index)
Adds a component at the specified tab index with a tab title defaulting to the name of
the component.
void add(Component component, Object constraints)
Adds a component to the tabbed pane.
void add(Component component, Object constraints, int index)
Adds a component at the specified tab index.
Component add(String title, Component component)
Adds a component with the specified tab title.
void addTab(String title, Component component)
Adds a component represented by a title and no icon.
void addTab(String title, Icon icon, Component component)
Adds a component represented by a title and/or icon, either of which can be null.
void addTab(String title, Icon icon, Component component, String tip)
Adds a component and tip represented by a title and/or icon, either of which can be null.
Color getBackgroundAt(int index)
Returns the tab background color at index.
Component getComponentAt(int index)
Returns the component at index.
Icon getIconAt(int index)
Returns the tab icon at index.
int getSelectedIndex()
Returns the currently selected index for this tabbedpane.
Component getTabComponentAt(int index)
Returns the tab component at index.
int getTabCount()
Returns the number of tabs in this tabbedpane.
String getTitleAt(int index)
Returns the tab title at index.
String getToolTipText(MouseEvent event)
Returns the tooltip text for the component determined by the mouse event location.
String getToolTipTextAt(int index)
Returns the tab tooltip text at index.
void insertTab(String title, Icon icon, Component component, String tip, int index)
Inserts a new tab for the given component, at the given index, represented by the given
title and/or icon, either of which may be null.
boolean isEnabledAt(int index)
Returns whether or not the tab at index is currently enabled.
void remove(Component component)
Removes the specified Component from the JTabbedPane.
void remove(int index)
Removes the tab and component which corresponds to the specified index.
void removeAll()
Removes all the tabs and their corresponding components from the tabbedpane.
void setBackgroundAt(int index, Color background)
Sets the background color at index to background which can be null, in which case the
tab's background color will default to the background color of the tabbedpane.
void setComponentAt(int index, Component component)
Sets the component at index to component.
void setEnabledAt(int index, boolean enabled)
Sets whether or not the tab at index is enabled.
void setForegroundAt(int index, Color foreground)
Sets the foreground color at index to foreground which can be null, in which case the
tab's foreground color will default to the foreground color of this tabbedpane.
void setIconAt(int index, Icon icon)
Sets the icon at index to icon which can be null.
void setSelectedComponent(Component c)
Sets the selected component for this tabbedpane.
void setSelectedIndex(int index)
Sets the selected index for this tabbedpane.
void setTabComponentAt(int index, Component component)
Sets the component that is responsible for rendering the title for the specified tab.
void setTitleAt(int index, String title)
Sets the title at index to title which can be null.
void setToolTipTextAt(int index, String toolTipText)
Sets the tooltip text at index to toolTipText which can be null.
JTable()
Constructs a default JTable that is initialized with a default data model, a default column
model, and a default selection model.
JTable(int numRows, int numColumns)
Constructs a JTable with numRows and numColumns of empty cells using
DefaultTableModel.
JTableHeader(TableColumnModel cm)
Constructs a JTableHeader which is initialized with cm as the column model.
Methods:
JTable getTable()
Returns the table associated with this header.
void setTable(JTable table)
Sets the table associated with this header.
JToolBar()
Creates a new tool bar; orientation defaults to HORIZONTAL.
JToolBar(int orientation)
Creates a new tool bar with the specified orientation.
JToolBar(String name)
Creates a new tool bar with the specified name.
JToolBar(String name, int orientation)
Creates a new tool bar with a specified name and orientation.
Methods:
void addSeparator()
Appends a separator of default size to the end of the tool bar.
Component getComponentAtIndex(int i)
Returns the component at the specified index.
int getOrientation()
Returns the current orientation of the tool bar.
boolean isBorderPainted()
Gets the borderPainted property.
void setBorderPainted(boolean b)
Sets the borderPainted property, which is true if the border should be painted.
void setLayout(LayoutManager mgr)
Sets the layout manager for this container.
void setOrientation(int o)
Sets the orientation of the tool bar.
JToolTip()
Creates a tool tip.
Methods:
String getTipText()
Returns the text that is shown when the tool tip is displayed.
void setTipText(String tipText)
Sets the text to show when the tool tip is displayed.
JTree()
Refer corejav2
JViewport()
Creates a JViewport.
Mthods:
int getScrollMode()
Returns the current scrolling mode.
Component getView()
Returns the JViewport's one child or null.
Dimension getViewSize()
If the view's size hasn't been explicitly set, return the preferred size, otherwise return the
view's current size.
void remove(Component child)
boolean getWrapStyleWord()
Gets the style of wrapping used if the text area is wrapping lines.
void insert(String str, int pos)
Inserts the specified text at the specified position.
void setColumns(int columns)
Sets the number of columns for this TextArea.
void setFont(Font f)
Sets the current font.
void setLineWrap(boolean wrap)
Sets the line-wrapping policy of the text area.
void setRows(int rows)
Sets the number of rows for this TextArea.
void setTabSize(int size)
Sets the number of characters to expand tabs to.
void setWrapStyleWord(boolean word)
Sets the style of wrapping used if the text area is wrapping lines.
JTextField()
Constructs a new TextField.
JTextField(int columns)
Constructs a new empty TextField with the specified number of columns.
JTextField(String text)
Constructs a new TextField initialized with the specified text.
JTextField(String text, int columns)
Constructs a new TextField initialized with the specified text and columns.
Methods:
int getColumns()
Returns the number of columns in this TextField.
protected int getColumnWidth()
Returns the column width.
int getHorizontalAlignment()
Returns the horizontal alignment of the text.
void setColumns(int columns)
Sets the number of columns in this TextField, and then invalidate the layout.
void setFont(Font f)
Sets the current font.
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text.
JPasswordField()
Constructs a new JPasswordField, with a default document, null starting text string, and
0 column width.
JPasswordField(int columns)
Constructs a new empty JPasswordField with the specified number of columns.
JPasswordField(String text)
Constructs a new JPasswordField initialized with the specified text.
JPasswordField(String text, int columns)
Constructs a new JPasswordField initialized with the specified text and columns.
Methods:
void copy()
Invokes provideErrorFeedback on the current look and feel, which typically initiates an
error beep.
void cut()
Invokes provideErrorFeedback on the current look and feel, which typically initiates an
error beep.
boolean echoCharIsSet()
Returns true if this JPasswordField has a character set for echoing.
char getEchoChar()
Returns the character to be used for echoing.
char[] getPassword()
Returns the text contained in this TextComponent.
void setEchoChar(char c)
Sets the echo character for this JPasswordField.
JButton()
Creates a button with no set text or icon.
JButton(Icon icon)
Creates a button with an icon.
JButton(String text)
Creates a button with text.
JButton(String text, Icon icon)
Creates a button with initial text and an icon.
Methods:
boolean isDefaultButton()
Gets the value of the defaultButton property, which if true means that this button is the
current default button for its JRootPane.
JMenuItem()
Creates a JMenuItem with no set text or icon.
JMenuItem(Icon icon)
Creates a JMenuItem with the specified icon.
JMenuItem(String text)
Creates a JMenuItem with the specified text.
JMenuItem(String text, Icon icon)
Creates a JMenuItem with the specified text and icon.
JMenuItem(String text, int mnemonic)
Creates a JMenuItem with the specified text and keyboard mnemonic.
Methods:
void setEnabled(boolean b)
Enables or disables the menu item.
JCheckBoxMenuItem()
Creates an initially unselected check box menu item with no set text or icon.
JCheckBoxMenuItem(Icon icon)
Creates an initially unselected check box menu item with an icon.
JCheckBoxMenuItem(String text)
Creates an initially unselected check box menu item with text.
JCheckBoxMenuItem(String text, boolean b)
Creates a check box menu item with the specified text and selection state.
JCheckBoxMenuItem(String text, Icon icon)
Creates an initially unselected check box menu item with the specified text and icon.
JCheckBoxMenuItem(String text, Icon icon, boolean b)
Creates a check box menu item with the specified text, icon, and selection state.
Methods:
boolean getState()
Returns the selected-state of the item.
void setState(boolean b)
Sets the selected-state of the item.
JRadioButtonMenuItem()
Creates a JRadioButtonMenuItem with no set text or icon.
JRadioButtonMenuItem(Icon icon)
Creates a JRadioButtonMenuItem with an icon.
JRadioButtonMenuItem(Icon icon, boolean selected)
Creates a radio button menu item with the specified image and selection state, but no
text.
JRadioButtonMenuItem(String text)
Creates a JRadioButtonMenuItem with text.
JRadioButtonMenuItem(String text, boolean selected)
Creates a radio button menu item with the specified text and selection state.
JRadioButtonMenuItem(String text, Icon icon)
Creates a radio button menu item with the specified text and Icon.
JRadioButtonMenuItem(String text, Icon icon, boolean selected)
Creates a radio button menu item that has the specified text, image, and selection state.
JCheckBox()
Creates an initially unselected check box button with no text, no icon.
JCheckBox(Icon icon)
Creates an initially unselected check box with an icon.
JCheckBox(Icon icon, boolean selected)
Creates a check box with an icon and specifies whether or not it is initially selected.
JCheckBox(String text)
Creates an initially unselected check box with text.
JCheckBox(String text, boolean selected)
Creates a check box with text and specifies whether or not it is initially selected.
JCheckBox(String text, Icon icon)
Creates an initially unselected check box with the specified text and icon.
JCheckBox(String text, Icon icon, boolean selected)
Creates a check box with text and icon, and specifies whether or not it is initially
selected.
Method:
JRadioButton()
Creates an initially unselected radio button with no set text.
JRadioButton(Icon icon)
Creates an initially unselected radio button with the specified image but no text.
JRadioButton(Icon icon, boolean selected)
Creates a radio button with the specified image and selection state, but no text.
JRadioButton(String text)
Creates an unselected radio button with the specified text.
JRadioButton(String text, boolean selected)
Creates a radio button with the specified text and selection state.
JRadioButton(String text, Icon icon)
Creates a radio button that has the specified text and image, and that is initially
unselected.
JRadioButton(String text, Icon icon, boolean selected)
Creates a radio button that has the specified text, image, and selection state.
JMenu()
void setSelected(boolean b)