Professional Documents
Culture Documents
Constructor Summary: Jcheckbox
Constructor Summary: Jcheckbox
Constructor Summary: Jcheckbox
Constructor Summary
Checkbox()
Creates a check box with the specified label and sets the specified state.
Checkbox(String label, boolean state, CheckboxGroup group)
Constructs a Checkbox with the specified label, set to the specified state, and in the specified check box group.
Checkbox(String label, CheckboxGroup group, boolean state)
Creates a check box with the specified label, in the specified check box group, and set to the specified state.
Method Summary
void addItemListener(ItemListener l)
Adds the specified item listener to receive item events from this check box.
void addNotify()
Returns an array of all the objects currently registered as FooListeners upon this Checkbox.
Object[] getSelectedObjects()
Processes item events occurring on this check box by dispatching them to any registered ItemListener objects.
void removeItemListener(ItemListener l)
Removes the specified item listener so that the item listener no longer receives item events from this check box.
void setCheckboxGroup(CheckboxGroup g)
Sets this check box's group to be the specified check box group.
void setLabel(String label)
Constructor Summary
JButton()
Creates a button where properties are taken from the Action supplied.
JButton(Icon icon)
Method Summary
protected void configurePropertiesFromAction(Action a)
Factory method which sets the AbstractButton's properties according to values from the Action instance.
AccessibleContext getAccessibleContext()
Returns a string that specifies the name of the L&F class that renders this component.
boolean isDefaultButton()
Gets the value of the defaultButton property, which if true means that this button is the current default button for its JRootPane.
boolean isDefaultCapable()
Overrides JComponent.removeNotify to check if this button is currently set as the default button on the RootPane, and if so,
sets the RootPane's default button to null to ensure theRootPane doesn't hold onto an invalid button reference.
void setDefaultCapable(boolean defaultCapable)
Sets the defaultCapable property, which determines whether this button can be made the default button for its root pane.
void updateUI()
Resets the UI property to a value from the current look and feel.
JComboBox
Constructor Summary
JComboBox()
Method Summary
void actionPerformed(ActionEvent e)
Adds an ActionListener.
void addItem(Object anObject)
Adds an ItemListener.
void addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener which will listen to notification messages from the popup portion of the combo box.
void configureEditor(ComboBoxEditor anEditor, Objec t anItem)
Factory method which sets the ActionEvent source's properties according to values from the Action instance.
void contentsChanged(ListDataEvent e)
protected
Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance. Returns an instance of the default keyselection manager. Notifies all listeners that have registered interest for notification on this event type.
protected
protected
void fireActionEvent()
protected
void fireItemStateChanged(ItemEvent e)
Notifies all listeners that have registered interest for notification on this event type.
void firePopupMenuCanceled()
Notifies PopupMenuListeners that the popup portion of the combo box has been canceled.
void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that the popup portion of the combo box has become invisible.
void firePopupMenuWillBecomeVisible()
Notifies PopupMenuListeners that the popup portion of the combo box will become visible.
AccessibleContext getAccessibleContext()
Returns the currently set Action for this ActionEvent source, or null if no Action is set.
String getActionCommand()
Returns the action command that is included in the event sent to action listeners.
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners added to this JComboBox with addActionListener().
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the selected item in the JComboBox field.
Object getItemAt(int index)
Returns an array of all the ItemListeners added to this JComboBox with addItemListener().
JComboBox.KeySelectionManager getKeySelectionManager()
Returns the maximum number of items the combo box can display without a scrollbar
ComboBoxModel getModel()
Returns an array of all the PopupMenuListeners added to this JComboBox with addPopupMenuListener().
Object getPrototypeDisplayValue()
Returns the "prototypical display" value - an Object used for the calculation of the display height and width.
ListCellRenderer getRenderer()
Returns the renderer used to display the selected item in the JComboBox field.
int getSelectedIndex()
Returns the first item in the list that matches the given item.
Object getSelectedItem()
ComboBoxUI getUI()
Returns the name of the L&F class that renders this component.
void hidePopup()
Removes an ActionListener.
void removeAllItems()
Removes the item at anIndex This method works only if the JComboBox uses a mutable data model.
void removeItemListener(ItemListener aListener)
Removes an ItemListener.
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener.
protected void selectedItemChanged()
Selects the list item that corresponds to the specified keyboard character and returns true, if there is an item corresponding to that character.
void setAction(Action a)
Sets the action command that should be included in the event sent to action listeners.
void setEditable(boolean aFlag)
Sets the editor used to paint and edit the selected item in the JComboBox field.
void setEnabled(boolean b)
Sets the object that translates a keyboard character into a list selection.
void setLightWeightPopupEnabled(boolean aFlag)
Sets the lightWeightPopupEnabled property, which provides a hint as to whether or not a lightweight Component should be used to contain the JComboBox, versus a heavyweight Component such as a Panel or a Window.
void setMaximumRowCount(int count)
Sets the data model that the JComboBox uses to obtain the list of items.
void setPopupVisible(boolean v)
Sets the prototype display value used to calculate the size of the display for the UI portion.
void setRenderer(ListCellRenderer aRenderer)
Sets the renderer that paints the list items and the item selected from the list in the JComboBox field.
void setSelectedIndex(int anIndex)
Sets the selected item in the combo box display area to the object in the argument.
void setUI(ComboBoxUI ui)
Resets the UI property to a value from the current look and feel.
JLabel
Constructor Summary
JLabel()
Creates a JLabel instance with no image and with an empty string for the title.
JLabel(Icon image)
Creates a JLabel instance with the specified image and horizontal alignment.
JLabel(String text)
Creates a JLabel instance with the specified text, image, and horizontal alignment.
JLabel(String text, int horizontalAlignment)
Creates a JLabel instance with the specified text and horizontal alignment.
Method Summary
protected int checkHorizontalKey(int key, String message)
Verify that key is a legal value for the verticalAlignment or verticalTextPosition properties.
AccessibleContext getAccessibleContext()
Returns the value of the disabledIcon property if it's been set, If it hasn't been set and the value of the icon property is an ImageIcon, we compute a "grayed out" version of the icon and update the disabledIcon property with that.
int getDisplayedMnemonic()
Returns the character, as an index, that the look and feel should provide decoration for as representing the mnemonic
character.
int getHorizontalAlignment()
Returns the horizontal position of the label's text, relative to its image.
Icon getIcon()
Returns the graphic image (glyph, icon) that the label displays.
int getIconTextGap()
Returns the amount of space between the text and the icon displayed in this label.
Component getLabelFor()
Returns a string that specifies the name of the l&f class that renders this component.
int getVerticalAlignment()
Returns the vertical position of the label's text, relative to its image.
boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.
protected String paramString()
(JLabel.setEnabled(false)).
void setDisplayedMnemonic(char aChar)
Provides a hint to the look and feel as to which character in the text should be decorated to represent the mnemonic.
void setHorizontalAlignment(int alignment)
Sets the horizontal position of the label's text, relative to its image.
void setIcon(Icon icon)
If both the icon and text properties are set, this property defines the space between them.
void setLabelFor(Component c)
Sets the vertical position of the label's text, relative to its image.
void updateUI()
Resets the UI property to a value from the current look and feel.
JList
Constructor Summary
JList()
Constructs a JList that displays the elements in the specified, non-null model.
JList(Object[] listData)
Method Summary
void addListSelectionListener(ListSelectionListener list ener)
Adds a listener to the list that's notified each time a change to the selection occurs.
void addSelectionInterval(int anchor, int lead)
Sets the selection to be the union of the specified interval with current selection.
void clearSelection()
Clears the selection - after calling this method isSelectionEmpty will return true.
protected ListSelectionM createSelectionModel() odel
Returns an instance
of DefaultListSelectionModel.
void ensureIndexIsVisible(int index)
int getAnchorSelectionIndex()
Returns the first index argument from the most recent addSelectionModel or setSelectionInterval call.
Rectangle getCellBounds(int index0, int index1)
Returns the fixed cell height value -- the value specified by setting the fixedCellHeight property, rather than that calculated from the list elements.
int getFixedCellWidth()
Returns the fixed cell width value -- the value specified by setting the fixedCellWidth property, rather than that calculated from the list elements.
int getLastVisibleIndex()
Returns JList.VERTICAL if the layout is a single column of cells, or JList.VERTICAL_WRAP if the layout is "newspaper style" with the content flowing vertically then horizontally orJList.HORIZONTAL_WRAP if the layout is "newspaper style" with the content flowing horizontally then vertically.
int getLeadSelectionIndex()
Returns the second index argument from the most recent addSelectionInterval or setSelectionInterval ca ll.
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners added to this JList with addListSelectionListener().
int getMaxSelectionIndex()
Returns the data model that holds the list of items displayed by the JList component.
int getNextMatch(String prefix, int startIndex, Position.Bias bias)
Returns the cell width of the "prototypical cell" -a cell used for the calculation of cell widths, because it has the same value as all other list items.
int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
Returns true if this JList is displayed in a JViewport and the viewport is taller than JList's preferred height, or if the layout orientation is VERTICAL_WRAP and the number of visible rows is <= 0; otherwise returns false.
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in a JViewport and the viewport is wider than JList's preferred width; or if the layout orientation is HORIZONTAL_WRAP and the visible row count is <= 0; otherwise returns false.
int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
Returns the distance to scroll to expose the next or previous row (for vertical scrolling) or character (for
horizontal scrolling).
int getSelectedIndex()
Overrides JComponent's getToolTipText method in order to allow the renderer's tips to be used if it has text set.
ListUI getUI()
Returns the look and feel (L&F) object that renders this component.
String getUIClassID()
Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component.
boolean getValueIsAdjusting()
int getVisibleRowCount()
Convert a point in JList coordinates to the closest index of the cell at that location.
protected String paramString()
Removes a listener from the list that's notified each time a change to the selection occurs.
void removeSelectionInterval(int index0, int index1)
Sets the selection to be the set difference of the specified interval and the current selection.
void setCellRenderer(ListCellRenderer cellRenderer)
Sets the delegate that's used to paint each cell in the list.
void setDragEnabled(boolean b)
Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
void setFixedCellHeight(int height)
Sets the model that represents the contents or "value" of the list and clears the list selection after notifying PropertyChangeListeners.
void setPrototypeCellValue(Object prototypeCellValue)
Computes the fixedCellWidth and fixedCellHeight properties by configuring the cellRenderer to index equals zero for the specified value and then computing the renderer component's preferred size.
void setSelectedIndex(int index)
Sets the look and feel (L&F) object that renders this component.
void setValueIsAdjusting(boolean b)
Sets the data model's isAdjusting property to true, so that a single event will be generated when all of the selection events have finished (for example, when the mouse is being dragged over the list in selection mode).
void setVisibleRowCount(int visibleRowCount)
Sets the preferred number of rows in the list that can be displayed without a scrollbar, as determined by the nearest JViewport ancestor, if any.
void updateUI()
Resets the UI property with the value from the current look and feel.
JMenu
Constructor Summary
JMenu()
Constructs a menu whose properties are taken from the Action supplied.
JMenu(String s)
Constructs a new JMenu with the supplied string as its text and specified as a tear-off menu or not.
Method Summary
JMenuItem add(Action a)
Creates a new menu item attached to the specified Action object and appends it to the end of this menu.
Component add(Component c)
Creates a new menu item with the specified text and appends it to the end of this menu.
void addMenuListener(MenuListener l)
o)
Sets the ComponentOrientation property of this menu and all components contained within it.
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent source's properties according to values from the Action instance.
protected PropertyChangeListe createActionChangeListener(JMenuItem b) ner
Returns a properly configured PropertyChangeListener which updates the control as changes to the Action occur. Factory method which creates the JMenuItem for Actions added to the JMenu.
protected
JMenuItem createActionComponent(Action a)
protected
JMenu.WinListener createWinListener(JPopupMenu p)
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuDeselected()
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuSelected()
Notifies all listeners that have registered interest for notification on this event type.
AccessibleContext getAccessibleContext()
Returns an array of all the MenuListeners added to this JMenu with addMenuListener().
JPopupMenu getPopupMenu()
Returns an array of MenuElements containing the submenu for this menu component.
String getUIClassID()
Returns the name of the L&F class that renders this component.
JMenuItem insert(Action a, int pos)
Inserts a new menu item attached to the specified Action object at a given position.
JMenuItem insert(JMenuItem mi, int pos)
Inserts a new menu item with the specified text at a given position.
void insertSeparator(int index)
Returns true if the menu is a 'top-level menu', that is, if it is the direct child of a menubar.
void menuSelectionChanged(boolean isIncluded)
Messaged when the menubar selection changes to activate or deactivate this menu.
protected String paramString()
Removes the menu item at the specified index from this menu.
void remove(JMenuItem item)
void setComponentOrientation(ComponentOrientation o
Sets the language-sensitive orientation that is to be used to order the elements or text within this component.
void setDelay(int d)
Sets the suggested delay before the menu's PopupMenu is popped up or down.
void setMenuLocation(int x, int y)
Sets the data model for the "menu button" -the label that the user clicks to open or close the menu.
void setPopupMenuVisible(boolean b)
Resets the UI property with a value from the current look and feel.
JMenuBar
Constructor Summary
JMenuBar()
Method Summary
JMenu add(JMenu c)
Overrides JComponent.addNotify to register this menu bar with the current keyboard manager.
AccessibleCont getAccessibleContext() ext Component getComponent()
Component getComponentAtIndex(int i)
i)
Returns the margin between the menubar's border and its menus.
JMenu getMenu(int index)
Returns the name of the L&F class that renders this component.
boolean isBorderPainted()
Implemented to be a MenuElement
protected void paintBorder(Graphics g)
-- does nothing.
protected
Overrides JComponent.removeNotify to unregister this menu bar with the current keyboard manager.
void setBorderPainted(boolean b)
Sets the help menu that appears when the user selects the "help" option in the menu bar.
void setMargin(Insets m)
Sets the margin between the menubar's border and its menus.
void setSelected(Component sel)
Resets the UI property with a value from the current look and feel.
JMenuItem
Constructor Summary
JMenuItem()
Creates a menu item whose properties are taken from the specified Action.
JMenuItem(Icon icon)
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Factory method which sets the ActionEvent source's properties according to values from the Action instance.
protected PropertyCha createActionPropertyChangeListener(Action a) ngeListener
Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
protected
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuDragMouseEntered(MenuDragMouseEvent event)
Notifies all listeners that have registered interest for notification on this event type.
protected
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuDragMouseReleased(MenuDragMouseEvent event)
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuKeyPressed(MenuKeyEvent event)
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuKeyReleased(MenuKeyEvent event)
Notifies all listeners that have registered interest for notification on this event type.
protected void fireMenuKeyTyped(MenuKeyEvent event)
Notifies all listeners that have registered interest for notification on this event type.
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator for the menu item.
AccessibleContext getAccessibleContext()
Returns an array of all the MenuDragMouseListeners added to this JMenuItem with addMenuDragMouseListener(). Returns an array of all the MenuKeyListeners added to this JMenuItem with addMenuKeyListener().
MenuKeyListener[] getMenuKeyListeners()
MenuElement[] getSubElements()
This method returns an array containing the sub-menu components for this menu component.
String getUIClassID()
Initializes the menu item with the specified text and icon.
boolean isArmed()
Processes a key event forwarded from the MenuSelectionManager and changes the menu selection, if necessary, by using MenuSelectionManager's API.
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Processes a mouse event forwarded from the MenuSelectionManager and changes the menu selection, if necessary, by using the MenuSelectionManager's API.
void removeMenuDragMouseListener(MenuDragMouseListener l)
Sets the key combination which invokes the menu item's action listeners without navigating the menu hierarchy.
void setArmed(boolean b)
void setEnabled(boolean b)
Sets the look and feel object that renders this component.
void updateUI()
Resets the UI property with a value from the current look and feel.
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with FlowLayout and the specified buffering strategy.
JPanel(LayoutManager layout)
Creates a new JPanel with the specified layout manager and buffering strategy.
Method Summary
AccessibleContext getAccessibleContext()
Returns the look and feel (L&F) object that renders this component.
String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.
protected String paramString()
Sets the look and feel (L&F) object that renders this component.
void updateUI()
Resets the UI property with a value from the current look and feel.
JRadioButton
Constructor Summary
JRadioButton()
Creates a radiobutton where properties are taken from the Action supplied.
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 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.
Method Summary
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent source's properties according to values from the Action instance.
protected PropertyChangeListene createActionPropertyChangeListener(Action a) r
Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
AccessibleContext getAccessibleContext()
Returns the name of the L&F class that renders this component.
protected String paramString()
Resets the UI property to a value from the current look and feel.
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem()
Creates a radio button menu item whose properties are taken from the Action supplied.
JRadioButtonMenuItem(Icon icon)
Creates a radio button menu item with the specified image and selection state, but no text.
JRadioButtonMenuItem(String text)
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.
Method Summary
AccessibleContext getAccessibleContext()
Returns the name of the L&F class that renders this component.
protected String paramString()
JPopupMenu
Constructor Summary
JPopupMenu()
Method Summary
JMenuItem add(Action a)
Appends a new menu item to the end of the menu which dispatches the specified Action object.
JMenuItem add(JMenuItem menuItem)
Creates a new menu item with the specified text and appends it to the end of this menu.
void addPopupMenuListener(PopupMenuListener l)
Returns a properly configured PropertyChangeListener which updates the control as changes to the Action occur. Factory method which creates the JMenuItem for Actions added to the JPopupMenu.
protected
JMenuItem createActionComponent(Action a)
protected
void firePopupMenuCanceled()
i)
Returns the margin, in pixels, between the popup menu's border and its containees.
PopupMenuListener[] getPopupMenuListeners()
Returns an array of all the PopupMenuListeners added to this JMenuItem with addPopupMenuListener().
SingleSelectionModel getSelectionModel()
Returns an array of MenuElements containing the submenu for this menu component.
PopupMenuUI getUI()
Returns the look and feel (L&F) object that renders this component.
String getUIClassID()
Returns the name of the L&F class that renders this component.
Inserts a menu item for the specified Action object at a given position.
void insert(Component component, int index)
Returns true if the MouseEvent is considered a popup trigger by the JPopupMenu's currently installed UI.
boolean isVisible()
Messaged when the menubar selection changes to activate or deactivate this menu.
void pack()
Lays out the container so that it uses the minimum space needed to display its contents.
protected void paintBorder(Graphics g)
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.
protected void processKeyEvent(KeyEvent evt)
This method is required to conform to the MenuElement interface, but it not implemented.
void remove(int pos)
Removes the component at the specified index from this popup menu.
void removePopupMenuListener(PopupMenuListener l)
Sets the invoker of this popup menu -- the component in which the popup menu menu is to be displayed.
void setLabel(String label)
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 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.
Displays the popup menu at the position x,y in the coordinate space of the component invoker.
void updateUI()
Resets the UI property to a value from the current look and feel.
JTable
Constructor Summary
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.
JTable(Object[][] rowData, Object[] columnNames)
Constructs a JTable to display the values in the two dimensional array, rowData, with column names, columnNames.
JTable(TableModel dm)
Constructs a JTable that is initialized with dm as the data model, a default column model, and a default selection model.
JTable(TableModel dm, TableColumnModel cm)
Constructs a JTable that is initialized with dm as the data model, cm as the column model, and a default selection model.
JTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
Constructs a JTable that is initialized with dm as the data model, cm as the column model, and sm as the selection model.
JTable(Vector rowData, Vector columnNames)
Constructs a JTable to display the values in the Vector of Vectors, rowData, with column names, columnNames.
Method Summary
void addColumn(TableColumn aColumn)
Appends aColumn to the end of the array of columns held by this JTable's column model.
void addColumnSelectionInterval(int index0, int index1)
Adds the columns from index0 to index1, inclusive, to the current selection.
void addNotify()
Updates the selection models of the table, depending on the state of the two flags: toggle and extend.
void clearSelection()
Returns the index of the column that point lies in, or -1 if the result is not in the range [0, getColumnCount()-1].
void columnMarginChanged(ChangeEvent e)
If this JTable is the viewportView of an enclosing JScrollPane (the usual situation), configure this ScrollPane by, amongst other things, installing the table's tableHeader as thecolumnHeaderView of the scroll pane.
int convertColumnIndexToModel(int viewColumnIndex)
Maps the index of the column in the view at viewColumnIndex to the index of the column in the table model.
int convertColumnIndexToView(int modelColumnIndex)
Maps the index of the column in the table model at modelColumnIndex to the index of the column in the
view.
protected TableColumnM createDefaultColumnModel() odel
Returns the default column model object, which is a DefaultTableColumnModel. Creates default columns for the table from the data model using the getColumnCount method defined in the TableModel interface.
void createDefaultColumnsFromModel()
protected
TableModel createDefaultDataModel()
Creates default cell editors for objects, numbers, and boolean values.
protected void createDefaultRenderers()
Creates default cell renderers for objects, numbers, doubles, dates, booleans, and icons.
protected ListSelectio createDefaultSelectionModel() nModel
Returns the default selection model object, which is a DefaultListSelectionModel. Returns the default table header object, which is a JTableHeader.
protected
JTableHeader createDefaultTableHeader()
Programmatically starts editing the cell at row and column, if the cell is editable.
boolean editCellAt(int row, int column, EventObject e)
Programmatically starts editing the cell at row and column, if the cell is editable.
void editingCanceled(ChangeEvent e)
void editingStopped(ChangeEvent e)
Determines whether the table will create default columns from the model.
int getAutoResizeMode()
Returns an appropriate editor for the cell specified by row and column.
Rectangle getCellRect(int row, int column, boolean includeSpacing)
Returns a rectangle for the cell that lies at the intersection of row and column.
TableCellRenderer getCellRenderer(int row, int column)
Returns an appropriate renderer for the cell specified by this row and column.
boolean getCellSelectionEnabled()
Returns true if both row and column selection models are enabled.
TableColumn getColumn(Object identifier)
Returns the TableColumn object for the column in the table whose identifier is equal to identifier, when compared using equals.
Class getColumnClass(int column)
Returns the type of the column appearing in the view at column position column.
int getColumnCount()
Returns the TableColumnModel that contains all column information of this table.
String getColumnName(int column)
Returns the name of the column appearing in the view at column position column.
boolean getColumnSelectionAllowed()
Returns the editor to be used when no editor has been set in a TableColumn.
TableCellRenderer getDefaultRenderer(Class columnClass)
Returns the cell renderer to be used when no renderer has been set in a TableColumn.
boolean getDragEnabled()
Returns the index of the column that contains the cell currently being edited.
int getEditingRow()
Returns the index of the row that contains the cell currently being edited.
Component getEditorComponent()
Returns the TableModel that provides the data displayed by this JTable.
Dimension getPreferredScrollableViewportSize()
Returns false to indicate that the height of the viewport does not determine the height of the table.
boolean getScrollableTracksViewportWidth()
Returns false if autoResizeMode is set to AUTO_RESIZE_OFF, which indicates that the width of the viewport does not determine the width of the table.
int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
Returns the scroll increment (in pixels) that completely exposes one new row or column (depending on the orientation).
int getSelectedColumn()
int getSelectedRowCount()
Returns true if the table draws horizontal lines between cells, false if it doesn't.
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between cells, false if it doesn't.
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Overrides JComponent's getToolTipText method in order to allow the renderer's tips to be used if it has text set.
TableUI getUI()
Returns the suffix used to construct the name of the L&F class used to render this component.
Object getValueAt(int row, int column)
Moves the column column to the position currently occupied by the column targetColumn in the view.
protected String paramString()
Prepares the editor by querying the data model for the value and selection state of the cell at row, column.
Component prepareRenderer(TableCellRenderer renderer, int row, int column)
Prepares the renderer by querying the data model for the value and selection state of the cell at row, column.
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
Invoked to process the key bindings for ks as the result of the KeyEvent e.
void removeColumn(TableColumn aColumn)
void removeEditor()
Discards the editor object and frees the real estate it used for cell rendering.
void removeNotify()
Returns the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1].
void selectAll()
Sets the table's auto resize mode when the table is resized.
void setCellEditor(TableCellEditor anEditor)
Sets whether this table allows both a column selection and a row selection to exist simultaneously.
void setColumnModel(TableColumnModel columnModel)
Sets the column model for this table to newModel and registers for listener notifications from the new column model.
void setColumnSelectionAllowed(boolean columnSelectionAllo wed)
Sets a default cell editor to be used if no editor has been set in a TableColumn.
void setDefaultRenderer(Class columnClass, TableCellRender er renderer)
Sets a default cell renderer to be used if no renderer has been set in a TableColumn.
void setDragEnabled(boolean b)
Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
void setEditingColumn(int aColumn)
Sets the color used to draw grid lines to gridColor and redisplays.
void setIntercellSpacing(Dimension intercellSpacing)
Sets the rowMargin and the columnMargin -- the height and width of the space between cells -to intercellSpacing.
void setModel(TableModel dataModel)
Sets the data model for this table to newModel and registers with it for listener notifications from the new data model.
void setPreferredScrollableViewportSize(Dimension size)
Sets the height, in pixels, of all cells to rowHeight, revalidates, and repaints.
void setRowHeight(int row, int rowHeight)
adjacent rows.
void setRowSelectionAllowed(boolean rowSelectionAllowed)
Sets the table's selection mode to allow only single selections, a single contiguous interval, or multiple intervals.
void setSelectionModel(ListSelectionModel newModel)
Sets the row selection model for this table to newModel and registers for listener notifications from the new selection model.
void setShowGrid(boolean showGrid)
Sets whether editors in this JTable get the keyboard focus when an editor is activated as a result of the JTable forwarding keyboard events for a cell.
void setTableHeader(JTableHeader tableHeader)
Sets the L&F object that renders this component and repaints.
Sets the value for the cell in the table model at row and column.
void sizeColumnsToFit(boolean lastColumnOnly)
Reverses the effect of configureEnclosingScrollPane by replacing the columnHeaderView of the enclosing scroll pane with null.
void updateUI()
Invoked when the row selection changes -- repaints to show the new selection.
JTextArea
Constructor Summary
JTextArea()
Constructs a new JTextArea with the given document model, and defaults for all of the other arguments (null, 0, 0).
JTextArea(Document doc, String text, int rows, int columns)
Constructs a new JTextArea with the specified number of rows and columns, and the given model.
JTextArea(int rows, int columns)
Constructs a new empty TextArea with the specified number of rows and columns.
JTextArea(String text)
Constructs a new TextArea with the specified text and number of rows and columns.
Method Summary
void append(String str)
Creates the default implementation of the model to be used at construction if one isn't explicitly given.
AccessibleContext getAccessibleContext()
Returns the preferred size of the viewport if this component is embedded in a JScrollPane.
Dimension getPreferredSize()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.
int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation.
int getTabSize()
Gets the style of wrapping used if the text area is wrapping lines.
void insert(String str, int pos)
Replaces text from the indicated start to end position with the new text specified.
void setColumns(int columns)
Sets the style of wrapping used if the text area is wrapping lines.
JTextComponent.KeyBinding
Constructor Summary
JTextComponent.KeyBinding(KeyStroke key, String actionName)
JTextField
Constructor Summary
JTextField()
Constructs a new JTextField that uses the given text storage model and the given number of columns.
JTextField(int columns)
Constructs a new TextField initialized with the specified text and columns.
Method Summary
void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this textfield.
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent source's properties according to values from the Action instance.
protected PropertyChangeListene createActionPropertyChangeListener(Action a) r
Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
protected Document createDefaultModel()
Creates the default implementation of the model to be used at construction if one isn't explicitly given.
protected void fireActionPerformed()
Notifies all listeners that have registered interest for notification on this event type.
AccessibleContext getAccessibleContext()
Returns the currently set Action for this ActionEvent source, or null if no Action is set.
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners added to this JTextField with addActionListener().
Action[] getActions()
Calls to revalidate that come from within the textfield itself will be handled by validating the textfield, unless the textfield is contained within a JViewport, in which case this returns false.
protected
String paramString()
Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects.
void removeActionListener(ActionListener l)
Removes the specified action listener so that it no longer receives action events from this textfield.
void scrollRectToVisible(Rectangle r)
Sets the number of columns in this TextField, and then invalidate the layout.
void setDocument(Document doc)
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or image.
JToggleButton(Action a)
Creates a toggle button where properties are taken from the Action supplied.
JToggleButton(Icon icon)
Creates an initially unselected toggle button with the specified image but no text.
JToggleButton(Icon icon, boolean selected)
Creates a toggle button with the specified image and selection state, but no text.
JToggleButton(String text)
Creates a toggle button with the specified text and selection state.
JToggleButton(String text, Icon icon)
Creates a toggle button that has the specified text and image, and that is initially unselected.
JToggleButton(String text, Icon icon, boolean selected)
Creates a toggle button with the specified text, image, and selection state.
Method Summary
AccessibleContext getAccessibleContext()
Returns a string that specifies the name of the l&f class that renders this component.
protected String paramString()
Resets the UI property to a value from the current look and feel.
JToolBar
Constructor Summary
JToolBar()
Method Summary
JButton add(Action a)
Returns a properly configured PropertyChangeListener which updates the control as changes to the Action occur, or null if the default property change listener for the control is desired.
protected JButton createActionComponent(Action a)
Factory method which creates the JButton for Actions added to the JToolBar.
AccessibleContext getAccessibleContext()
Returns the margin between the tool bar's border and its buttons.
int getOrientation()
Returns the name of the L&F class that renders this component.
boolean isBorderPainted()
Sets the borderPainted property, which is true if the border should be painted.
void setFloatable(boolean b)
Sets the margin between the tool bar's border and its buttons.
void setOrientation(int o)
JTree
Constructor Summary
JTree()
Returns a JTree created from a Hashtable which does not display with root.
JTree(Object[] value)
Returns a JTree with each element of the specified array as the child of a new root node which is not displayed.
JTree(TreeModel newModel)
Returns an instance of JTree which displays the root node -- the tree is created using the specified data model.
JTree(TreeNode root)
Returns a JTree with the specified TreeNode as its root, which displays the root node.
JTree(TreeNode root, boolean asksAllowsChildren)
Returns a JTree with the specified TreeNode as its root, which displays the root node and which decides whether a node is a leaf node in the specified manner.
JTree(Vector value)
Returns a JTree with each element of the specified Vector as the child of a new root node which is not displayed.
Method Summary
void addSelectionInterval(int index0, int index1)
Adds the paths between index0 and index1, inclusive, to the selection.
void addSelectionPath(TreePath path)
Adds the node identified by the specified TreePath to the current selection.
void addSelectionPaths(TreePath[] paths)
Adds the paths at each of the specified rows to the current selection.
void addTreeExpansionListener(TreeExpansionListener tel)
Ensures that the node identified by the specified path is collapsed and viewable.
void collapseRow(int row)
Creates and returns an instance of TreeModelHandler. Ensures that the node identified by the specified path is expanded and viewable.
Ensures that the node in the specified row is expanded and viewable.
void fireTreeCollapsed(TreePath path)
Notifies all listeners that have registered interest for notification on this event type.
void fireTreeExpanded(TreePath path)
Notifies all listeners that have registered interest for notification on this event type.
void fireTreeWillCollapse(TreePath path)
Notifies all listeners that have registered interest for notification on this event type.
void fireTreeWillExpand(TreePath path)
Notifies all listeners that have registered interest for notification on this event type.
protected void fireValueChanged(TreeSelectionEvent e)
Notifies all listeners that have registered interest for notification on this event type.
AccessibleContext getAccessibleContext()
Creates and returns a sample TreeModel. Returns an Enumeration of TreePaths that have
Returns an Enumeration of the descendants of the path parent that are currently expanded.
boolean getExpandsSelectedPaths()
Returns the indicator that tells what happens when editing is interrupted.
Object getLastSelectedPathComponent()
Returns the last path component in the first node of the current selection.
TreePath getLeadSelectionPath()
Returns the TreePath to the next tree element that begins with a prefix.
protected TreePath[] getPathBetweenRows(int index0, int index1)
Returns JTreePath instances representing the path between index0 and index1 (including index1).
Rectangle getPathBounds(TreePath path)
Returns the Rectangle that the specified node will be drawn into.
TreePath getPathForLocation(int x, int y)
Returns the Rectangle that the node at the specified row is drawn in.
int getRowCount()
Returns the row that displays the node identified by the specified path.
int getRowHeight()
Returns the amount for a block increment, which is the height or width of visibleRect, based on orientation.
boolean getScrollableTracksViewportHeight()
Returns false to indicate that the height of the viewport does not determine the height of the table, unless the preferred height of the tree is smaller than the viewports height.
boolean getScrollableTracksViewportWidth()
Returns false to indicate that the width of the viewport does not determine the width of the table, unless the preferred width of the tree is smaller than the viewports width.
Overrides JComponent's getToolTipText method in order to allow renderer's tips to be used if it has text set.
TreeExpansionListener[] getTreeExpansionListeners()
Returns an array of all the TreeExpansionListeners added to this JTree with addTreeExpansionListener().
TreeSelectionListener[] getTreeSelectionListeners()
Returns an array of all the TreeSelectionListeners added to this JTree with addTreeSelectionListener().
TreeWillExpandListener[] getTreeWillExpandListeners()
Returns an array of all the TreeWillExpandListeners added to this JTree with addTreeWillExpandListener().
TreeUI getUI()
component.
String getUIClassID()
Returns the name of the L&F class that renders this component.
int getVisibleRowCount()
Returns the number of rows that are displayed in the display area.
boolean hasBeenExpanded(TreePath path)
Returns true if the node identified by the path has ever been expanded.
boolean isCollapsed(int row)
Returns true if the value identified by path is currently collapsed, this will return false if any of the values in path are currently not being displayed.
boolean isEditable()
Returns true if the node at the specified display row is currently expanded.
boolean isExpanded(TreePath path)
Returns isEditable.
boolean isPathSelected(TreePath path)
Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded.
void makeVisible(TreePath path)
Removes any descendants of the TreePaths in toRemove that have been expanded.
void removeSelectionInterval(int index0, int index1)
Removes the nodes between index0 and index1, inclusive, from the selection.
void removeSelectionPath(TreePath path)
Removes the node identified by the specified path from the current selection.
void removeSelectionPaths(TreePath[] paths)
Removes the nodes identified by the specified paths from the current selection.
void removeSelectionRow(int row)
Removes the row at the index row from the current selection.
void removeSelectionRows(int[] rows)
Removes the rows that are selected at each of the specified rows.
void removeTreeExpansionListener(TreeExpansionListener t el)
Makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed.
void scrollRowToVisible(int row)
Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
void setEditable(boolean flag)
Determines what happens when editing is interrupted by selecting another node in the tree, a change in the tree's data, or by some other means.
void setLargeModel(boolean newValue)
Determines whether or not the root node from the TreeModel is visible.
void setRowHeight(int rowHeight)
Sets the scrollsOnExpand property, which determines whether the tree might scroll to show previously hidden children.
void setSelectionInterval(int index0, int index1)
Selects the nodes corresponding to each of the specified rows in the display.
void setShowsRootHandles(boolean newValue)
Sets the value of the showsRootHandles property, which specifies whether the node handles should be displayed.
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node will expand or close.
void setUI(TreeUI ui)
Selects the node identified by the specified path and initiates editing.
boolean stopEditing()
Sent when the tree has changed enough that we need to resize the bounds, but not enough that we need to remove the expanded node set (e.g nodes were expanded or collapsed, or nodes were inserted into the tree).
void updateUI()