Post on 04-Apr-2018
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 175
JCheckbox
Method Summary
void addItemListener(ItemListener l)
Adds the specified item listener to receive item events
from this check box
void addNotify()
Creates the peer of the Checkbox
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this Checkbox
CheckboxGroup getCheckboxGroup()
Determines this check boxs group
ItemListener[] getItemListeners()
Returns an array of all the item listeners registered on this
checkbox
String getLabel()
Gets the label of this check boxEventListener[] getListeners(Class listenerType)
Returns an array of all the objects currently registered
as FooListeners upon this Checkbox
Object[] getSelectedObjects()
Returns an array (length 1) containing the checkbox label
Constructor Summary
Checkbox()
Creates a check box with no labelCheckbox(String label)
Creates a check box with the specified label
Checkbox(String label boolean state)
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 275
or null if the checkbox is not selected
boolean getState()
Determines whether this check box is in the on or off
state
protected String paramString()
Returns a string representing the state of this Checkbox
protected void processEvent(AWTEvent e)
Processes events on this check box
protected void processItemEvent(ItemEvent e)
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 itemlistener no longer receives item events from this check box
void setCheckboxGroup(CheckboxGroup g)
Sets this check boxs group to be the specified check box
group
void setLabel(String label)
Sets this check boxs label to be the string argument
void setState(boolean state)
Sets the state of this check box to the specified state
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 375
Constructor Summary
JButton() Creates a button with no set text or icon
JButton(Action a)
Creates a button where properties are taken from the Action supplied
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
Method Summary
protected void configurePropertiesFromAction(Action a)
Factory method which sets the AbstractButtons properties
according to values from the Action instance
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JButton
String getUIClassID()
Returns a string that specifies the name of the LampF 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()
Gets the value of the defaultCapable propertyprotected String paramString()
Returns a string representation of this JButton
void removeNotify()
Overrides JComponentremoveNotify to check if this button
is currently set as the default button on the RootPane and if so
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 475
sets the RootPanes default button to null to ensure
theRootPane doesnt 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 rootpane
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 575
JComboBox
Constructor Summary
JComboBox()
Creates aJComboBox
with a default data modelJComboBox(ComboBoxModel aModel)
Creates a JComboBox that takes its items from an existing ComboBoxModel
JComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array
JComboBox(Vector items)
Creates a JComboBox that contains the elements in the specified Vector
Method Summary void actionPerformed (ActionEvent e)
This method is public as an implementation
side effect
void addActionListener(ActionListener l)
Adds an ActionListener
void addItem (Object anObject)
Adds an item to the item list
void addItemListener(ItemListener aListener)
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)
Initializes the editor with the specified item
protected void configurePropertiesFromAction(Action a)
Factory method which sets
the ActionEvent sources properties according to
values from the Action instance
void contentsChanged (ListDataEvent e)
This method is public as an implementation
side effect
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 675
protected PropertyChangeListe
ner createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instanceprotected JComboBoxKeySelect
ionManager createDefaultKeySelectionManager()
Returns an instance of the default key-
selection manager
protected void fireActionEvent()
Notifies all listeners that have registered
interest for notification on this event type
protected void fireItemStateChanged (ItemEvent e)
Notifies all listeners that have registered
interest for notification on this event typevoid 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()
Gets the AccessibleContext associated with
this JComboBox
Action getAction()
Returns the currently set Action for
this ActionEvent source or null if no Action is set
String getActionCommand ()
Returns the action command that is includedin the event sent to action listeners
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners
added to this JComboBox with
addActionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 275
or null if the checkbox is not selected
boolean getState()
Determines whether this check box is in the on or off
state
protected String paramString()
Returns a string representing the state of this Checkbox
protected void processEvent(AWTEvent e)
Processes events on this check box
protected void processItemEvent(ItemEvent e)
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 itemlistener no longer receives item events from this check box
void setCheckboxGroup(CheckboxGroup g)
Sets this check boxs group to be the specified check box
group
void setLabel(String label)
Sets this check boxs label to be the string argument
void setState(boolean state)
Sets the state of this check box to the specified state
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 375
Constructor Summary
JButton() Creates a button with no set text or icon
JButton(Action a)
Creates a button where properties are taken from the Action supplied
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
Method Summary
protected void configurePropertiesFromAction(Action a)
Factory method which sets the AbstractButtons properties
according to values from the Action instance
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JButton
String getUIClassID()
Returns a string that specifies the name of the LampF 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()
Gets the value of the defaultCapable propertyprotected String paramString()
Returns a string representation of this JButton
void removeNotify()
Overrides JComponentremoveNotify to check if this button
is currently set as the default button on the RootPane and if so
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 475
sets the RootPanes default button to null to ensure
theRootPane doesnt 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 rootpane
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 575
JComboBox
Constructor Summary
JComboBox()
Creates aJComboBox
with a default data modelJComboBox(ComboBoxModel aModel)
Creates a JComboBox that takes its items from an existing ComboBoxModel
JComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array
JComboBox(Vector items)
Creates a JComboBox that contains the elements in the specified Vector
Method Summary void actionPerformed (ActionEvent e)
This method is public as an implementation
side effect
void addActionListener(ActionListener l)
Adds an ActionListener
void addItem (Object anObject)
Adds an item to the item list
void addItemListener(ItemListener aListener)
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)
Initializes the editor with the specified item
protected void configurePropertiesFromAction(Action a)
Factory method which sets
the ActionEvent sources properties according to
values from the Action instance
void contentsChanged (ListDataEvent e)
This method is public as an implementation
side effect
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 675
protected PropertyChangeListe
ner createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instanceprotected JComboBoxKeySelect
ionManager createDefaultKeySelectionManager()
Returns an instance of the default key-
selection manager
protected void fireActionEvent()
Notifies all listeners that have registered
interest for notification on this event type
protected void fireItemStateChanged (ItemEvent e)
Notifies all listeners that have registered
interest for notification on this event typevoid 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()
Gets the AccessibleContext associated with
this JComboBox
Action getAction()
Returns the currently set Action for
this ActionEvent source or null if no Action is set
String getActionCommand ()
Returns the action command that is includedin the event sent to action listeners
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners
added to this JComboBox with
addActionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 375
Constructor Summary
JButton() Creates a button with no set text or icon
JButton(Action a)
Creates a button where properties are taken from the Action supplied
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
Method Summary
protected void configurePropertiesFromAction(Action a)
Factory method which sets the AbstractButtons properties
according to values from the Action instance
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JButton
String getUIClassID()
Returns a string that specifies the name of the LampF 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()
Gets the value of the defaultCapable propertyprotected String paramString()
Returns a string representation of this JButton
void removeNotify()
Overrides JComponentremoveNotify to check if this button
is currently set as the default button on the RootPane and if so
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 475
sets the RootPanes default button to null to ensure
theRootPane doesnt 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 rootpane
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 575
JComboBox
Constructor Summary
JComboBox()
Creates aJComboBox
with a default data modelJComboBox(ComboBoxModel aModel)
Creates a JComboBox that takes its items from an existing ComboBoxModel
JComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array
JComboBox(Vector items)
Creates a JComboBox that contains the elements in the specified Vector
Method Summary void actionPerformed (ActionEvent e)
This method is public as an implementation
side effect
void addActionListener(ActionListener l)
Adds an ActionListener
void addItem (Object anObject)
Adds an item to the item list
void addItemListener(ItemListener aListener)
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)
Initializes the editor with the specified item
protected void configurePropertiesFromAction(Action a)
Factory method which sets
the ActionEvent sources properties according to
values from the Action instance
void contentsChanged (ListDataEvent e)
This method is public as an implementation
side effect
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 675
protected PropertyChangeListe
ner createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instanceprotected JComboBoxKeySelect
ionManager createDefaultKeySelectionManager()
Returns an instance of the default key-
selection manager
protected void fireActionEvent()
Notifies all listeners that have registered
interest for notification on this event type
protected void fireItemStateChanged (ItemEvent e)
Notifies all listeners that have registered
interest for notification on this event typevoid 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()
Gets the AccessibleContext associated with
this JComboBox
Action getAction()
Returns the currently set Action for
this ActionEvent source or null if no Action is set
String getActionCommand ()
Returns the action command that is includedin the event sent to action listeners
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners
added to this JComboBox with
addActionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 475
sets the RootPanes default button to null to ensure
theRootPane doesnt 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 rootpane
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 575
JComboBox
Constructor Summary
JComboBox()
Creates aJComboBox
with a default data modelJComboBox(ComboBoxModel aModel)
Creates a JComboBox that takes its items from an existing ComboBoxModel
JComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array
JComboBox(Vector items)
Creates a JComboBox that contains the elements in the specified Vector
Method Summary void actionPerformed (ActionEvent e)
This method is public as an implementation
side effect
void addActionListener(ActionListener l)
Adds an ActionListener
void addItem (Object anObject)
Adds an item to the item list
void addItemListener(ItemListener aListener)
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)
Initializes the editor with the specified item
protected void configurePropertiesFromAction(Action a)
Factory method which sets
the ActionEvent sources properties according to
values from the Action instance
void contentsChanged (ListDataEvent e)
This method is public as an implementation
side effect
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 675
protected PropertyChangeListe
ner createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instanceprotected JComboBoxKeySelect
ionManager createDefaultKeySelectionManager()
Returns an instance of the default key-
selection manager
protected void fireActionEvent()
Notifies all listeners that have registered
interest for notification on this event type
protected void fireItemStateChanged (ItemEvent e)
Notifies all listeners that have registered
interest for notification on this event typevoid 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()
Gets the AccessibleContext associated with
this JComboBox
Action getAction()
Returns the currently set Action for
this ActionEvent source or null if no Action is set
String getActionCommand ()
Returns the action command that is includedin the event sent to action listeners
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners
added to this JComboBox with
addActionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 575
JComboBox
Constructor Summary
JComboBox()
Creates aJComboBox
with a default data modelJComboBox(ComboBoxModel aModel)
Creates a JComboBox that takes its items from an existing ComboBoxModel
JComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array
JComboBox(Vector items)
Creates a JComboBox that contains the elements in the specified Vector
Method Summary void actionPerformed (ActionEvent e)
This method is public as an implementation
side effect
void addActionListener(ActionListener l)
Adds an ActionListener
void addItem (Object anObject)
Adds an item to the item list
void addItemListener(ItemListener aListener)
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)
Initializes the editor with the specified item
protected void configurePropertiesFromAction(Action a)
Factory method which sets
the ActionEvent sources properties according to
values from the Action instance
void contentsChanged (ListDataEvent e)
This method is public as an implementation
side effect
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 675
protected PropertyChangeListe
ner createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instanceprotected JComboBoxKeySelect
ionManager createDefaultKeySelectionManager()
Returns an instance of the default key-
selection manager
protected void fireActionEvent()
Notifies all listeners that have registered
interest for notification on this event type
protected void fireItemStateChanged (ItemEvent e)
Notifies all listeners that have registered
interest for notification on this event typevoid 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()
Gets the AccessibleContext associated with
this JComboBox
Action getAction()
Returns the currently set Action for
this ActionEvent source or null if no Action is set
String getActionCommand ()
Returns the action command that is includedin the event sent to action listeners
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners
added to this JComboBox with
addActionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 675
protected PropertyChangeListe
ner createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instanceprotected JComboBoxKeySelect
ionManager createDefaultKeySelectionManager()
Returns an instance of the default key-
selection manager
protected void fireActionEvent()
Notifies all listeners that have registered
interest for notification on this event type
protected void fireItemStateChanged (ItemEvent e)
Notifies all listeners that have registered
interest for notification on this event typevoid 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()
Gets the AccessibleContext associated with
this JComboBox
Action getAction()
Returns the currently set Action for
this ActionEvent source or null if no Action is set
String getActionCommand ()
Returns the action command that is includedin the event sent to action listeners
ActionListener[] getActionListeners()
Returns an array of all the ActionListeners
added to this JComboBox with
addActionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 775
ComboBoxEditor getEditor()
Returns the editor used to paint and edit the
selected item in the JComboBox field
Object getItemAt(int index)
Returns the list item at the specified indexint getItemCount()
Returns the number of items in the list
ItemListener[] getItemListeners()
Returns an array of all the ItemListeners
added to this JComboBox with addItemListener()
JComboBoxKeySelectionManager getKeySelectionManager()
Returns the lists key-selection manager
int getMaximumRowCount() Returns the maximum number of items the
combo box can display without a scrollbar
ComboBoxModel getModel()
Returns the data model currently used by
the JComboBox
PopupMenuListener[] getPopupMenuListeners()
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 matchesthe given item
Object getSelectedItem ()
Returns the current selected item
Object[] getSelectedObjects()
Returns an array containing the selected item
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 875
ComboBoxUI getUI()
Returns the LampF object that renders this
component
String getUIClassID()
Returns the name of the LampF class thatrenders this component
void hidePopup()
Causes the combo box to close its popup
window
void insertItemAt(Object anObject int index)
Inserts an item into the item list at a given
index
protected void installAncestorListener()
void intervalAdded (ListDataEvent e)
This method is public as an implementation
side effect
void intervalRemoved (ListDataEvent e)
This method is public as an implementation
side effect
boolean isEditable()
Returns true if the JComboBox is editableboolean isLightWeightPopupEnabled ()
Gets the value of
the lightWeightPopupEnabled property
boolean isPopupVisible()
Determines the visibility of the popup
protected String paramString()
Returns a string representation of
this JComboBox
void processKeyEvent(KeyEvent e)
Handles KeyEvents looking for the Tab key
void removeActionListener(ActionListener l)
Removes an ActionListener
void removeAllItems()
Removes all items from the item list
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 975
void removeItem (Object anObject)
Removes an item from the item list
void removeItemAt(int anIndex)
Removes the item at anIndex This method
works only if the JComboBox uses a mutable datamodel
void removeItemListener(ItemListener aListener)
Removes an ItemListener
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenuListener
protected void selectedItemChanged ()
This protected method is implementation
specific
boolean selectWithKeyChar(char keyChar)
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 for the ActionEvent source
void setActionCommand (String aCommand)
Sets the action command that should be
included in the event sent to action listenersvoid setEditable(boolean aFlag)
Determines whether the JComboBox field is
editable
void setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the
selected item in the JComboBox field
void setEnabled (boolean b)
Enables the combo box so that items can be
selectedvoid setKeySelectionManager(JComboBoxKeySelectionM
anager aManager)
Sets the object that translates a keyboard
character into a list selection
void setLightWeightPopupEnabled (boolean aFlag)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1075
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 Windowvoid setMaximumRowCount(int count)
Sets the maximum number of rows
the JComboBox displays
void setModel(ComboBoxModel aModel)
Sets the data model that the JComboBox uses to
obtain the list of items
void setPopupVisible(boolean v)
Sets the visibility of the popup
void setPrototypeDisplayValue(Object prototypeDisplayValue)
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)
Selects the item at index anIndexvoid setSelectedItem (Object anObject)
Sets the selected item in the combo box
display area to the object in the argument
void setUI(ComboBoxUI ui)
Sets the LampF object that renders this
component
void showPopup()
Causes the combo box to display its popup
window
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1175
JLabel
Constructor Summary
JLabel()
Creates aJLabel
instance with no image and with an empty string for the titleJLabel(Icon image)
Creates a JLabel instance with the specified image
JLabel(Icon image int horizontalAlignment)
Creates a JLabel instance with the specified image and horizontal alignment
JLabel(String text)
Creates a JLabel instance with the specified text
JLabel(String text Icon icon int horizontalAlignment)
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
horizontalAlignment properties
protected int checkVerticalKey(int key String message)
Verify that key is a legal value for the verticalAlignment
or verticalTextPosition properties
AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Icon getDisabledIcon()
Returns the value of the disabledIcon property if its been
set If it hasnt 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()
Return the keycode that indicates a mnemonic key
int getDisplayedMnemonicIndex()
Returns the character as an index that the look and feel
should provide decoration for as representing the mnemonic
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1275
character
int getHorizontalAlignment()
Returns the alignment of the labels contents along the X
axis
int getHorizontalTextPosition()
Returns the horizontal position of the labels 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()
Get the component this is labelling
String getText()
Returns the text string that the label displays
LabelUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this componentint getVerticalAlignment()
Returns the alignment of the labels contents along the Y
axis
int getVerticalTextPosition()
Returns the vertical position of the labels 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 IconsImage is not equal to the passed in Image img
protected String paramString()
Returns a string representation of this JLabel
void setDisabledIcon(Icon disabledIcon)
Set the icon to be displayed if this JLabel is disabled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1375
(JLabelsetEnabled(false))
void setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value
void setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key
void setDisplayedMnemonicIndex(int index)
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 alignment of the labels contents along the X axis
void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the labels text relative to its
imagevoid setIcon(Icon icon)
Defines the icon this component will display
void setIconTextGap(int iconTextGap)
If both the icon and text properties are set this property
defines the space between them
void setLabelFor(Component c)
Set the component this is labelling
void setText(String text)
Defines the single line of text this component will display
void setUI(LabelUI ui)
Sets the LampF object that renders this component
void setVerticalAlignment(int alignment)
Sets the alignment of the labels contents along the Y axis
void setVerticalTextPosition(int textPosition)
Sets the vertical position of the labels text relative to its
image
void updateUI() Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1475
JList
Constructor Summary
JList()
Constructs aJList
with an empty modelJList(ListModel dataModel)
Constructs a JList that displays the elements in the specified non-null model
JList(Object[] listData)
Constructs a JList that displays the elements in the specified array
JList(Vector listData)
Constructs a JList that displays the elements in the specified Vector
Method Summary void addListSelectionListener(ListSelectionListener list
ener)
Adds a listener to the list thats 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 thismethod isSelectionEmpty will return true
protected ListSelectionModel
createSelectionModel()
Returns an instance
of DefaultListSelectionModel
void ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified cell
completely visible
protected void fireSelectionValueChanged (int firstIndex
int lastIndex boolean isAdjusting) Notifies JList ListSelectionListeners that the
selection model has changed
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JList
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1575
int getAnchorSelectionIndex()
Returns the first index argument from the most
recent addSelectionModel or setSelectionInterval call
Rectangle getCellBounds(int index0 int index1)
Returns the bounds of the specified range of itemsin JList coordinates
ListCellRenderer getCellRenderer()
Returns the object that renders the list items
boolean getDragEnabled ()
Gets the dragEnabled property
int getFirstVisibleIndex()
Returns the index of the first visible cell
int getFixedCellHeight() 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 the index of the last visible cellint getLayoutOrientation()
Returns JListVERTICAL if the layout is a single
column of cells or JListVERTICAL_WRAP if the layout is
newspaper style with the content flowing vertically
then horizontally orJListHORIZONTAL_WRAP if the layout
is newspaper style with the content flowing
horizontally then vertically
int getLeadSelectionIndex()
Returns the second index argument from the mostrecent addSelectionInterval or setSelectionInterval ca
ll
ListSelectionListener[] getListSelectionListeners()
Returns an array of all the ListSelectionListeners
added to this JList with addListSelectionListener()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1675
int getMaxSelectionIndex()
Returns the largest selected cell index
int getMinSelectionIndex()
Returns the smallest selected cell index
ListModel getModel()
Returns the data model that holds the list of items
displayed by the JList component
int getNextMatch(String prefix
int startIndex PositionBias bias)
Returns the next list element that starts with a
prefix
Dimension getPreferredScrollableViewportSize()
Computes the size of the viewport needed to
display visibleRowCount rowsObject getPrototypeCellValue()
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 the distance to scroll to expose the next or
previous block
boolean getScrollableTracksViewportHeight() Returns true if this JList is displayed in
a JViewport and the viewport is taller than JLists
preferred height or if the layout orientation
is VERTICAL_WRAP and the number of visible rows is lt= 0
otherwise returns false
boolean getScrollableTracksViewportWidth()
Returns true if this JList is displayed in
a JViewport and the viewport is wider than JLists
preferred width or if the layout orientationis HORIZONTAL_WRAP and the visible row count is lt= 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1775
horizontal scrolling)
int getSelectedIndex()
Returns the first selected index returns -1 if there
is no selected item
int[] getSelectedIndices()
Returns an array of all of the selected indices in
increasing order
Object getSelectedValue()
Returns the first selected value or null if the
selection is empty
Object[] getSelectedValues()
Returns an array of the values for the selected
cells
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the selection foreground color
int getSelectionMode()
Returns whether single-item or multiple-item
selections are allowed
ListSelectionModel getSelectionModel()
Returns the value of the current selection modelString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
ListUI getUI()
Returns the look and feel (LampF) object that
renders this component
String getUIClassID()
Returns the suffix used to construct the name of
the look and feel (LampF) class used to render this
component
boolean getValueIsAdjusting()
Returns the value of the data
models isAdjusting property
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1875
int getVisibleRowCount()
Returns the preferred number of visible rows
Point indexToLocation(int index)
Returns the origin of the specified item
in JList coordinatesboolean isSelectedIndex(int index)
Returns true if the specified index is selected
boolean isSelectionEmpty()
Returns true if nothing is selected
int locationToIndex(Point location)
Convert a point in JList coordinates to the closest
index of the cell at that location
protected String paramString() Returns a string representation of this JList
void removeListSelectionListener(ListSelectionListener l
istener)
Removes a listener from the list thats 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 thats 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 height of every cell in the list
void setFixedCellWidth(int width) Sets the width of every cell in the list
void setLayoutOrientation(int layoutOrientation)
Defines the way list cells are layed out
void setListData(Object[] listData)
Constructs a ListModel from an array of objects
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 1975
and then applies setModel to it
void setListData(Vector listData)
Constructs a ListModel from a Vector and then
applies setModel to it
void setModel(ListModel model)
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
components preferred sizevoid setSelectedIndex(int index)
Selects a single cell
void setSelectedIndices(int[] indices)
Selects a set of cells
void setSelectedValue(Object anObject
boolean shouldScroll)
Selects the specified object from the list
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionInterval(int anchor int lead)
Selects the specified interval
void setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item
selections are allowed
void setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a non-
null ListSelectionModel implementation
void setUI(ListUI ui)
Sets the look and feel (LampF) object that renders
this component
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2075
void setValueIsAdjusting(boolean b)
Sets the data models 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2175
JMenu
Constructor Summary
JMenu()
Constructs a newJMenu
with no textJMenu(Action a)
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
JMenu(String s boolean b)
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)
Appends a component to the end of this
menu
Component add (Component c int index) Adds the specified component to this
container at the given position
JMenuItem add (JMenuItem menuItem)
Appends a 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 addMenuListener(MenuListener l)
Adds a listener for menu events
void addSeparator()
Appends a new separator to the end of the
menu
void applyComponentOrientation(ComponentOrientation
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2275
o)
Sets the ComponentOrientation property of
this menu and all components contained within it
protected void configurePropertiesFromAction(Action a)
Factory method which setsthe ActionEvent sources properties according to
values from the Action instance
protected PropertyChangeListe
ner createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates
the control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JMenuprotected JMenuWinListener createWinListener(JPopupMenu p)
Creates a window-closing listener for the
popup
void doClick(int pressTime)
Programmatically performs a click
protected void fireMenuCanceled ()
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()
Gets the AccessibleContext associated with
this JMenuComponent getComponent()
Returns the javaawtComponent used to
paint this MenuElement
int getDelay()
Returns the suggested delay in milliseconds
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2375
before submenus are popped up or down
JMenuItem getItem (int pos)
Returns the JMenuItem at the specified
position
int getItemCount()
Returns the number of items on the menu
including separators
Component getMenuComponent(int n)
Returns the component at position n
int getMenuComponentCount()
Returns the number of components on the
menu
Component[] getMenuComponents() Returns an array of Components of the menus
subcomponents
MenuListener[] getMenuListeners()
Returns an array of all the MenuListeners
added to this JMenu with addMenuListener()
JPopupMenu getPopupMenu()
Returns the popupmenu associated with this
menu
protected Point getPopupMenuOrigin() Computes the origin for the JMenus popup
menu
MenuElement[] getSubElements()
Returns an array of MenuElements containing
the submenu for this menu component
String getUIClassID()
Returns the name of the LampF 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 the specified JMenuitem at a given
position
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2475
void insert(String s int pos)
Inserts a new menu item with the specified
text at a given position
void insertSeparator(int index)
Inserts a separator at the specified positionboolean isMenuComponent(Component c)
Returns true if the specified component
exists in the submenu hierarchy
boolean isPopupMenuVisible()
Returns true if the menus popup window is
visible
boolean isSelected ()
Returns true if the menu is currently selected
(highlighted)
boolean isTearOff()
Returns true if the menu can be torn off
boolean isTopLevelMenu()
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 menuprotected String paramString()
Returns a string representation of this JMenu
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as
mnemonics and accelerators
void remove(Component c)
Removes the component c from this menu
void remove(int pos)
Removes the menu item at the specified
index from this menu
void remove(JMenuItem item)
Removes the specified menu item from this
menu
void removeAll()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2575
Removes all menu items from this menu
void removeMenuListener(MenuListener l)
Removes a listener for menu events
void setAccelerator(KeyStroke keyStroke)
setAccelerator is not defined for JMenu
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
menus PopupMenu is popped up or down
void setMenuLocation(int x int y)
Sets the location of the popup component
void setModel(ButtonModel newModel)
Sets the data model for the menu button --
the label that the user clicks to open or close the
menu
void setPopupMenuVisible(boolean b)
Sets the visibility of the menus popup
void setSelected (boolean b)
Sets the selection status of the menu
void updateUI()
Resets the UI property with a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2675
JMenuBar
Constructor Summary
JMenuBar()
Creates a new menu bar
Method Summary
JMenu add (JMenu c)
Appends the specified menu to the end of the menu bar
void addNotify()
Overrides JComponentaddNotify to register this menu bar
with the current keyboard manager
AccessibleCont
ext getAccessibleContext() Gets the AccessibleContext associated with this JMenuBar
Component getComponent()
Implemented to be a MenuElement
Component getComponentAtIndex(int i)
Deprecated replaced by getComponent(int i)
int getComponentIndex(Component c)
Returns the index of the specified component
JMenu getHelpMenu()
Gets the help menu for the menu bar
Insets getMargin()
Returns the margin between the menubars border and its
menus
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
SingleSelectionModel
getSelectionModel() Returns the model object that handles single selections
MenuElement[] getSubElements()
Implemented to be a MenuElement -- returns the menus in this
menu bar
MenuBarUI getUI()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2775
Returns the menubars current UI
String getUIClassID()
Returns the name of the LampF class that renders this
component
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
void menuSelectionChanged (boolean isIncluded)
Implemented to be a MenuElement -- does nothing
protected void paintBorder(Graphics g)
Paints the menubars border if BorderPainted property is trueprotected Stri
ng paramString()
Returns a string representation of this JMenuBar
protected bool
ean processKeyBinding(KeyStroke ks KeyEvent e int condition
boolean pressed)
Subclassed to check all the child menus
void processKeyEvent(KeyEvent e MenuElement[] path MenuSelection
Manager manager)
Implemented to be a MenuElement -- does nothing
void processMouseEvent(MouseEvent event MenuElement[] path MenuSelectionManager manager)
Implemented to be a MenuElement -- does nothing
void removeNotify()
Overrides JComponentremoveNotify to unregister this menu
bar with the current keyboard manager
void setBorderPainted (boolean b)
Sets whether the border should be painted
void setHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects thehelp option in the menu bar
void setMargin(Insets m)
Sets the margin between the menubars border and its menus
void setSelected (Component sel)
Sets the currently selected component producing a a change
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2875
to the selection model
void setSelectionModel(SingleSelectionModel model)
Sets the model object to handle single selections
void setUI(MenuBarUI ui)
Sets the LampF object that renders this component
void updateUI()
Resets the UI property with a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 2975
JMenuItem
Constructor Summary
JMenuItem ()
Creates aJMenuItem
with no set text or iconJMenuItem (Action a)
Creates a menu item whose properties are taken from the specified Action
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
Method Summary
void addMenuDragMouseListener(MenuDragMouseListener l)
Adds a MenuDragMouseListener to the menu item
void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the menu item
protected void configurePropertiesFromAction(Action a)
Factory method which sets the ActionEvent sources
properties according to values from the Action instance
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)
Factory method which creates
the PropertyChangeListener used to update
the ActionEvent source as properties change on
its Action instance
protected void fireMenuDragMouseDragged (MenuDragMouseEvent event) 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3075
protected void fireMenuDragMouseExited (MenuDragMouseEvent event)
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 fornotification 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 fornotification on this event type
KeyStroke getAccelerator()
Returns the KeyStroke which serves as an accelerator
for the menu item
AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this JMenuItem
Component getComponent() Returns the javaawtComponent used to paint this
object
MenuDragMouseListener
[] getMenuDragMouseListeners()
Returns an array of all the MenuDragMouseListeners
added to this JMenuItem with
addMenuDragMouseListener()
MenuKeyListener[] getMenuKeyListeners()
Returns an array of all the MenuKeyListeners added to
this JMenuItem with addMenuKeyListener()MenuElement[] getSubElements()
This method returns an array containing the sub-menu
components for this menu component
String getUIClassID()
Returns the suffix used to construct the name of the
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3175
LampF class used to render this component
protected void init(String text Icon icon)
Initializes the menu item with the specified text and
icon
boolean isArmed ()
Returns whether the menu item is armed
void menuSelectionChanged (boolean isIncluded)
Called by the MenuSelectionManager when
the MenuElement is selected or unselected
protected String paramString()
Returns a string representation of this JMenuItem
void processKeyEvent(KeyEvent e MenuElement[] path MenuSe
lectionManager manager)
Processes a key event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using MenuSelectionManagers API
void processMenuDragMouseEvent(MenuDragMouseEvent e)
Handles mouse drag in a menu
void processMenuKeyEvent(MenuKeyEvent e)
Handles a keystroke in a menu
void processMouseEvent(MouseEvent e MenuElement[] path Me
nuSelectionManager manager)
Processes a mouse event forwarded from
the MenuSelectionManager and changes the menu selection
if necessary by using the MenuSelectionManagers API
void removeMenuDragMouseListener(MenuDragMouseListener l)
Removes a MenuDragMouseListener from the menu
item
void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the menu item
void setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu
items action listeners without navigating the menu
hierarchy
void setArmed (boolean b)
Identifies the menu item as armed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3275
void setEnabled (boolean b)
Enables or disables the menu item
void setUI(MenuItemUI ui)
Sets the look and feel object that renders this
componentvoid updateUI()
Resets the UI property with a value from the current
look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3375
JPanel
Constructor Summary
JPanel()
Creates a new JPanel with a double buffer and a flow layout
JPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout and the specified buffering strategy
JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager
JPanel(LayoutManager layout boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JPanel
PanelUI getUI()
Returns the look and feel (LampF) object that renders this
component
String getUIClassID()
Returns a string that specifies the name of the LampF class
that renders this componentprotected String paramString()
Returns a string representation of this JPanel
void setUI(PanelUI ui)
Sets the look and feel (LampF) object that renders this
component
void updateUI()
Resets the UI property with a value from the current look
and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3575
with this JRadioButton
String getUIClassID()
Returns the name of the LampF class that
renders this component
protected String paramString()
Returns a string representation of this
JRadioButton
void updateUI()
Resets the UI property to a value from the
current look and feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3675
JRadioButtonMenuItem
Constructor Summary
JRadioButtonMenuItem ()
Creates aJRadioButtonMenuItem
with no set text or iconJRadioButtonMenuItem (Action a)
Creates a radio button menu item whose properties are taken from
the Action supplied
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
Method Summary
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JRadioButtonMenuItem
String getUIClassID()
Returns the name of the LampF class that renders this
component
protected String paramString()
Returns a string representation of
this JRadioButtonMenuItem
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3775
JPopupMenu
Constructor Summary
JPopupMenu()
Constructs aJPopupMenu
without an invokerJPopupMenu(String label)
Constructs a JPopupMenu with the specified title
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) 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 addPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener
void addSeparator()
Appends a new separator at the end of the menuprotected PropertyCh
angeListener createActionChangeListener(JMenuItem b)
Returns a properly
configured PropertyChangeListener which updates the
control as changes to the Action occur
protected JMenuItem createActionComponent(Action a)
Factory method which creates
the JMenuItem for Actions added to the JPopupMenu
protected void firePopupMenuCanceled ()
Notifies PopupMenuListeners that this popup menu is
cancelled
protected void firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will
become invisible
protected void firePopupMenuWillBecomeVisible()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3875
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 3975
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 agiven position
boolean isBorderPainted ()
Checks whether the border should be painted
boolean isLightWeightPopupEnabled ()
Gets the lightWeightPopupEnabled property
boolean isPopupTrigger(MouseEvent e)
Returns true if the MouseEvent is considered a popup
trigger by the JPopupMenus currently installed UI
boolean isVisible()
Returns true if the popup menu is visible (currently
being displayed)
void menuSelectionChanged (boolean isIncluded)
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 contentsprotected void paintBorder(Graphics g)
Paints the popup menus border if
the borderPainted property is true
protected String paramString()
Returns a string representation of this JPopupMenu
protected void processFocusEvent(FocusEvent evt)
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects
protected void processKeyEvent(KeyEvent evt)
Processes key stroke events such as mnemonics and
accelerators
void processKeyEvent(KeyEvent e MenuElement[] path MenuSel
ectionManager manager)
This method is required to conform to
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4075
the MenuElement interface but it not implemented
void processMouseEvent(MouseEvent event MenuElement[] path
MenuSelectionManager manager)
This method is required to conform to
the MenuElement interface but it not implementedvoid remove(int pos)
Removes the component at the specified index from
this popup menu
void removePopupMenuListener(PopupMenuListener l)
Removes a PopupMenu listener
void setBorderPainted (boolean b)
Sets whether the border should be painted
static void setDefaultLightWeightPopupEnabled (boolean aFlag)
Sets the default value of
the lightWeightPopupEnabled property
void setInvoker(Component invoker)
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 popup menus label
void setLightWeightPopupEnabled (boolean aFlag)
Sets the value of the lightWeightPopupEnabled property which by default
is true
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4175
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4375
the current selection
void changeSelection(int rowIndex int columnIndex
boolean toggle boolean extend)
Updates the selection models of the table depending
on the state of the two flags toggle and extendvoid clearSelection()
Deselects all selected columns and rows
void columnAdded (TableColumnModelEvent e)
Invoked when a column is added to the table column
model
int columnAtPoint(Point point)
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)
Invoked when a column is moved due to a margin
change
void columnMoved (TableColumnModelEvent e)
Invoked when a column is repositioned
void columnRemoved (TableColumnModelEvent e)
Invoked when a column is removed from the table
column model
void columnSelectionChanged (ListSelectionEvent e)
Invoked when the selection model of
the TableColumnModel is changed
protected void configureEnclosingScrollPane()
If this JTable is the viewportView of an
enclosing JScrollPane (the usual situation) configure
this ScrollPane by amongst other things installing the
tables 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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4475
view
protected TableColumnModel
createDefaultColumnModel()
Returns the default column model object which is
a DefaultTableColumnModel
void createDefaultColumnsFromModel()
Creates default columns for the table from the data
model using the getColumnCount method defined in
the TableModel interface
protected TableModel createDefaultDataModel()
Returns the default table model object which is
a DefaultTableModel
protected void createDefaultEditors()
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 ListSelectionModel
createDefaultSelectionModel()
Returns the default selection model object which is
a DefaultListSelectionModel
protected JTableHeader createDefaultTableHeader()
Returns the default table header object which isa JTableHeader
static JScrollPane createScrollPaneForTable(JTable aTable) Deprecated As of Swing version 102 replaced
by new JScrollPane(aTable)
void doLayout()
Causes this table to lay out its rows and columns
boolean editCellAt(int row int column)
Programmatically starts editing the cell
at row and column if the cell is editableboolean 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)
Invoked when editing is canceled
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4575
void editingStopped (ChangeEvent e)
Invoked when editing is finished
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this
JTableboolean getAutoCreateColumnsFromModel()
Determines whether the table will create default
columns from the model
int getAutoResizeMode()
Returns the auto resize mode of the table
TableCellEditor getCellEditor()
Returns the cell editor
TableCellEditor getCellEditor(int row int column) Returns an appropriate editor for the cell specified
by row and column
Rectangle getCellRect(int row int columnboolean 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 theview at column position column
int getColumnCount()
Returns the number of columns in the column
model
TableColumnModel getColumnModel()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4675
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 columnboolean getColumnSelectionAllowed ()
Returns true if columns can be selected
TableCellEditor getDefaultEditor(Class columnClass)
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 ()
Gets the value of the dragEnabled property
int getEditingColumn()
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 component that is handling the editing
session
Color getGridColor()
Returns the color used to draw grid lines
Dimension getIntercellSpacing()
Returns the horizontal and vertical space between
cells
TableModel getModel()
Returns the TableModel that provides the data
displayed by this JTable
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this
table
int getRowCount()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4775
Returns the number of rows in this tables model
int getRowHeight()
Returns the height of a table row in pixels
int getRowHeight(int row)
Returns the height in pixels of the cells in row
int getRowMargin()
Gets the amount of empty space in pixels between
cells
boolean getRowSelectionAllowed ()
Returns true if rows can be selected
int getScrollableBlockIncrement(Rectangle visibleRect
int orientation int direction)
Returns visibleRectheight or visibleRectwidth
depending on this tables orientation
boolean getScrollableTracksViewportHeight()
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()
Returns the index of the first selected column -1 if
no column is selected
int getSelectedColumnCount()
Returns the number of selected columns
int[] getSelectedColumns()
Returns the indices of all selected columns
int getSelectedRow()
Returns the index of the first selected row -1 if no
row is selected
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4875
int getSelectedRowCount()
Returns the number of selected rows
int[] getSelectedRows()
Returns the indices of all selected rows
Color getSelectionBackground ()
Returns the background color for selected cells
Color getSelectionForeground ()
Returns the foreground color for selected cells
ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to
maintain row selection state
boolean getShowHorizontalLines()
Returns true if the table draws horizontal linesbetween cells false if it doesnt
boolean getShowVerticalLines()
Returns true if the table draws vertical lines between
cells false if it doesnt
boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when
keystrokes cause the editor to be activated
JTableHeader getTableHeader()
Returns the tableHeader used by this JTableString getToolTipText(MouseEvent event)
Overrides JComponents getToolTipText method in
order to allow the renderers tips to be used if it has text
set
TableUI getUI()
Returns the LampF object that renders this component
String getUIClassID()
Returns the suffix used to construct the name of the
LampF class used to render this component
Object getValueAt(int row int column)
Returns the cell value at row and column
protected void initializeLocalVars()
Initializes table properties to their default values
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 4975
boolean isCellEditable(int row int column)
Returns true if the cell at row and column is editable
boolean isCellSelected (int row int column)
Returns true if the cell at the specified position is
selectedboolean isColumnSelected (int column)
Returns true if the column at the specified index is
selected
boolean isEditing()
Returns true if a cell is being edited
boolean isRowSelected (int row)
Returns true if the row at the specified index is
selected
void moveColumn(int column int targetColumn)
Moves the column column to the position currently
occupied by the column targetColumn in the view
protected String paramString()
Returns a string representation of this table
Component prepareEditor(TableCellEditor editor int row
int column)
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)
Removes aColumn from this JTables array of columns
void removeColumnSelectionInterval(int index0
int index1)
Deselects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5075
void removeEditor()
Discards the editor object and frees the real estate it
used for cell rendering
void removeNotify()
Calls the unconfigureEnclosingScrollPane methodvoid removeRowSelectionInterval(int index0 int index1)
Deselects the rows from index0 to index1 inclusive
protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint
int rowAtPoint(Point point)
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() Selects all rows columns and cells in the table
void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this tables autoCreateColumnsFromModel flag
void setAutoResizeMode(int mode)
Sets the tables auto resize mode when the table is
resized
void setCellEditor(TableCellEditor anEditor)
Sets the cellEditor variablevoid setCellSelectionEnabled (boolean cellSelectionEnabled)
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 columnSelectionAllowed)
Sets whether the columns in this model can be
selected
void setColumnSelectionInterval(int index0 int index1)
Selects the columns from index0 to index1
inclusive
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5175
void setDefaultEditor(Class columnClass TableCellEditor e
ditor)
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 editingColumn variable
void setEditingRow(int aRow)
Sets the editingRow variable
void setGridColor(Color gridColor)
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 intercellSpacingvoid 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 preferred size of the viewport for this table
void setRowHeight(int rowHeight)
Sets the height in pixels of all cells to rowHeight
revalidates and repaintsvoid setRowHeight(int row int rowHeight)
Sets the height for row to rowHeight revalidates and
repaints
void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5275
adjacent rows
void setRowSelectionAllowed (boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected
void setRowSelectionInterval(int index0 int index1)
Selects the rows from index0 to index1 inclusive
void setSelectionBackground (Color selectionBackground)
Sets the background color for selected cells
void setSelectionForeground (Color selectionForeground)
Sets the foreground color for selected cells
void setSelectionMode(int selectionMode)
Sets the tables selection mode to allow only single
selections a single contiguous interval or multiple
intervalsvoid 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 the table draws grid lines around cells
void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines
between cellsvoid setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between
cells
void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
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 tableHeader working with
this JTable to newHeader
void setUI(TableUI ui)
Sets the LampF object that renders this component and
repaints
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5375
void setValueAt(Object aValue int row int column)
Sets the value for the cell in the table model
at row and column
void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated As of Swing version 103 replaced by doLayout()
void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v14
void tableChanged (TableModelEvent e)
Invoked when this tables TableModel generates
a TableModelEvent
protected void unconfigureEnclosingScrollPane()
Reverses the effect
of configureEnclosingScrollPane by replacingthe columnHeaderView of the enclosing scroll pane
with null
void updateUI()
Notification from the UIManager that the LampF has
changed
void valueChanged (ListSelectionEvent e)
Invoked when the row selection changes -- repaints
to show the new selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5475
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5575
int getLineEndOffset(int line)
Determines the offset of the end of the given line
int getLineOfOffset(int offset)
Translates an offset into the components text to a line
numberint getLineStartOffset(int line)
Determines the offset of the start of the given line
boolean getLineWrap()
Gets the line-wrapping policy of the text area
Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport if this
component is embedded in a JScrollPane
Dimension getPreferredSize() Returns the preferred size of the TextArea
protected int getRowHeight()
Defines the meaning of the height of a row
int getRows()
Returns the number of rows in the TextArea
boolean getScrollableTracksViewportWidth()
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 number of characters used to expand tabs
String getUIClassID()
Returns the class ID for the UI
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
protected String paramString()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5675
Returns a string representation of this JTextArea
void replaceRange(String str int start int end)
Replaces text from the indicated start to end position with
the new text specified
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5775
JTextComponentKeyBinding
Constructor Summary
JTextComponentKeyBinding(KeyStroke key String actionName)
Creates a new key binding
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5875
JTextField
Constructor Summary
JTextField ()
Constructs a newTextField
JTextField (Document doc String text int columns)
Constructs a new JTextField that uses the given text storage model and the
given number of columns
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
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 sources properties according tovalues from the Action instance
protected PropertyChangeListene
r createActionPropertyChangeListener(Action a)
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 themodel to be used at construction if one isnt
explicitly given
protected void fireActionPerformed ()
Notifies all listeners that have registered
interest for notification on this event type
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 5975
AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated
with this JTextField
Action getAction()
Returns the currently set Action forthis 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()
Fetches the command list for the editor
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
BoundedRangeModel getHorizontalVisibility() Gets the visibility of the text field
Dimension getPreferredSize()
Returns the preferred
size Dimensions needed for this TextField
int getScrollOffset()
Gets the scroll offset in pixels
String getUIClassID()
Gets the class ID for a UI
boolean isValidateRoot()
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
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6075
protected String paramString()
Returns a string representation of
this JTextField
void postActionEvent()
Processes action events occurring on thistextfield 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)
Scrolls the field left or right
void setAction(Action a) Sets the Action for
the ActionEvent source
void setActionCommand (String command)
Sets the command string used for action
events
void setColumns(int columns)
Sets the number of columns in
this TextField and then invalidate the layout
void setDocument(Document doc)
Associates the editor with a text
document
void setFont(Font f)
Sets the current font
void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text
void setScrollOffset(int scrollOffset)
Sets the scroll offset in pixels
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6175
JToggleButton
Constructor Summary
JToggleButton()
Creates an initially unselected toggle button without setting the text or imageJToggleButton(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 an unselected toggle button with the specified text
JToggleButton(String text boolean selected)
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()
Gets the AccessibleContext associated with this
JToggleButton
String getUIClassID()
Returns a string that specifies the name of the lampf class
that renders this component
protected String paramString()
Returns a string representation of this JToggleButton
void updateUI()
Resets the UI property to a value from the current look and
feel
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6275
JToolBar
Constructor Summary
JToolBar()
Creates a new tool bar orientation defaults toHORIZONTAL
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
Method Summary JButton add (Action a)
Adds a new JButton which dispatches the
action
protected void addImpl(Component comp Object constraints
int index)
If a JButton is being added it is initially
set to be disabled
void addSeparator()
Appends a separator of default size to theend of the tool bar
void addSeparator(Dimension size)
Appends a separator of a specified size to
the end of the tool bar
protected PropertyChangeListener createActionChangeListener(JButton b)
Returns a properly
configured PropertyChangeListener which
updates the control as changes to
the Action occur or null if the default propertychange 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()
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6375
Gets the AccessibleContext associated
with this JToolBar
Component getComponentAtIndex(int i)
Returns the component at the specified
indexint getComponentIndex(Component c)
Returns the index of the specified
component
Insets getMargin()
Returns the margin between the tool bars
border and its buttons
int getOrientation()
Returns the current orientation of the tool
bar
ToolBarUI getUI()
Returns the tool bars current UI
String getUIClassID()
Returns the name of the LampF class that
renders this component
boolean isBorderPainted ()
Gets the borderPainted property
boolean isFloatable() Gets the floatable property
boolean isRollover()
Returns the rollover state
protected void paintBorder(Graphics g)
Paints the tool bars border if
the borderPainted property is true
protected String paramString()
Returns a string representation of
this JToolBar
void setBorderPainted (boolean b)
Sets the borderPainted property which
is true if the border should be painted
void setFloatable(boolean b)
Sets the floatable property which must
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6475
be true for the user to move the tool bar
void setLayout(LayoutManager mgr)
Sets the layout manager for this container
void setMargin(Insets m)
Sets the margin between the tool bars
border and its buttons
void setOrientation(int o)
Sets the orientation of the tool bar
void setRollover(boolean rollover)
Sets the rollover state of this toolbar
void setUI(ToolBarUI ui)
Sets the LampF object that renders this
componentvoid updateUI()
Notification from the UIFactory that the
LampF has changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6575
JTree
Constructor Summary
JTree()
Returns aJTree
with a sample modelJTree(Hashtable value)
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 each path in the array of paths to the current
selection
void addSelectionRow(int row)
Adds the path at the specified row to the current
selection
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6675
void addSelectionRows(int[] rows)
Adds the paths at each of the specified rows to the
current selection
void addTreeExpansionListener(TreeExpansionListener tel)
Adds a listener for TreeExpansion events
void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a listener for TreeSelection events
void addTreeWillExpandListener(TreeWillExpandListener te
l)
Adds a listener for TreeWillExpand events
void cancelEditing()
Cancels the current editing session
void clearSelection()
Clears the selection
protected void clearToggledPaths()
Clears the cache of toggled tree paths
void collapsePath(TreePath path)
Ensures that the node identified by the specified
path is collapsed and viewable
void collapseRow(int row)
Ensures that the node in the specified row iscollapsed
String convertValueToText(Object value boolean selected
boolean expanded boolean leaf int row
boolean hasFocus)
Called by the renderers to convert the specified
value to text
protectedstatic TreeModel
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object
protected TreeModelListener createTreeModelListener()
Creates and returns an instance
of TreeModelHandler
void expandPath(TreePath path)
Ensures that the node identified by the specified
path is expanded and viewable
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6775
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6875
been expanded that are descendants of parent
boolean getDragEnabled ()
Gets the value of the dragEnabled property
TreePath getEditingPath()
Returns the path to the element that is currently
being edited
Enumeration getExpandedDescendants(TreePath parent)
Returns an Enumeration of the descendants of the
path parent that are currently expanded
boolean getExpandsSelectedPaths()
Returns the expandsSelectedPaths property
boolean getInvokesStopCellEditing()
Returns the indicator that tells what happens whenediting is interrupted
Object getLastSelectedPathComponent()
Returns the last path component in the first node
of the current selection
TreePath getLeadSelectionPath()
Returns the path identified as the lead
int getLeadSelectionRow()
Returns the row index corresponding to the lead
pathint getMaxSelectionRow()
Returns the last selected row
int getMinSelectionRow()
Gets the first selected row
TreeModel getModel()
Returns the TreeModel that is providing the data
TreePath getNextMatch(String prefix
int startingRow PositionBias bias)
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)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 6975
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7075
int getScrollableUnitIncrement(Rectangle visibleRect
int orientation int direction)
Returns the amount to increment when scrolling
boolean getScrollsOnExpand ()
Returns the value of the scrollsOnExpand propertyint getSelectionCount()
Returns the number of nodes selected
TreeSelectionModel getSelectionModel()
Returns the model for selections
TreePath getSelectionPath()
Returns the path to the first selected node
TreePath[] getSelectionPaths()
Returns the paths of all selected values
int[] getSelectionRows()
Returns all of the currently selected rows
boolean getShowsRootHandles()
Returns the value of
the showsRootHandles property
int getToggleClickCount()
Returns the number of mouse clicks needed to
expand or close a node
String getToolTipText(MouseEvent event) Overrides JComponents getToolTipText method in
order to allow renderers 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()
Returns the LampF object that renders this
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7175
component
String getUIClassID()
Returns the name of the LampF 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 node at the specified display
row is collapsed
boolean isCollapsed (TreePath path)
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 tree is editable
boolean isEditing()
Returns true if the tree is being edited
boolean isExpanded (int row) Returns true if the node at the specified display
row is currently expanded
boolean isExpanded (TreePath path)
Returns true if the node identified by the path is
currently expanded
boolean isFixedRowHeight()
Returns true if the height of each display row is a
fixed size
boolean isLargeModel()
Returns true if the tree is configured for a large
model
boolean isPathEditable(TreePath path)
Returns isEditable
boolean isPathSelected (TreePath path)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7275
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7375
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 rowsvoid removeTreeExpansionListener(TreeExpansionListener t
el)
Removes a listener for TreeExpansion events
void removeTreeSelectionListener(TreeSelectionListener t
sl)
Removes a TreeSelection listener
void removeTreeWillExpandListener(TreeWillExpandListener
tel)
Removes a listener for TreeWillExpand events
void scrollPathToVisible(TreePath path)
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)
Scrolls the item identified by row until it is
displayed
void setAnchorSelectionPath(TreePath newPath) Sets the path identified as the anchor
void setCellEditor(TreeCellEditor cellEditor)
Sets the cell editor
void setCellRenderer(TreeCellRenderer x)
Sets the TreeCellRenderer that will be used to
draw each cell
void setDragEnabled (boolean b)
Sets the dragEnabled property which must
be true to enable automatic drag handling (the first partof drag and drop) on this component
void setEditable(boolean flag)
Determines whether the tree is editable
protected void setExpandedState(TreePath path boolean state)
Sets the expanded state of this JTree
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7475
void setExpandsSelectedPaths(boolean newValue)
Configures the expandsSelectedPaths property
void setInvokesStopCellEditing(boolean newValue)
Determines what happens when editing is
interrupted by selecting another node in the tree achange in the trees data or by some other means
void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model
void setLeadSelectionPath(TreePath newPath)
Sets the path identifies as the lead
void setModel(TreeModel newModel)
Sets the TreeModel that will provide the data
void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the TreeModel is visible
void setRowHeight(int rowHeight)
Sets the height of each cell in pixels
void setScrollsOnExpand (boolean newValue)
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 between index0 and index1
inclusive
void setSelectionModel(TreeSelectionModel selectionModel
)
Sets the trees selection model
void setSelectionPath(TreePath path)
Selects the node identified by the specified path
void setSelectionPaths(TreePath[] paths)
Selects the nodes identified by the specified arrayof paths
void setSelectionRow(int row)
Selects the node at the specified row in the
display
void setSelectionRows(int[] rows)
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed
7302019 Constructor Summary
httpslidepdfcomreaderfullconstructor-summary 7575
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 bedisplayed
void setToggleClickCount(int clickCount)
Sets the number of mouse clicks before a node
will expand or close
void setUI(TreeUI ui)
Sets the LampF object that renders this component
void setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed
void startEditingAtPath(TreePath path)
Selects the node identified by the specified path
and initiates editing
boolean stopEditing()
Ends the current editing session
void treeDidChange()
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 (eg nodes wereexpanded or collapsed or nodes were inserted into the
tree)
void updateUI()
Notification from the UIManager that the LampF has
changed