Chapter 26. The javax.swing.event PackageThe javax.swing.event package augments the java.awt.event package and defines event objects, listeners, and adapters that are specific to Swing components. Classes with names ending in "Event" define event types; their fields and methods provide details about the event that occurred. Interfaces with names ending in "Listener" are event listeners. The methods of these interfaces are invoked to notify interested objects when specific events occur. Classes with names ending in "Adapter" are convenient no-op implementations of listener interfaces. Typically, it is easier to subclass an adapter class than implement the corresponding listener interface from scratch. Figure 26-1 shows the event classes of this package, while Figure 26-2 shows the event listeners. Figure 26-1. The events of the javax.swing.event packageFigure 26-2. The event listeners of the javax.swing.event package
An event of this type is generated by a JComponent when it is moved, becomes visible, or becomes invisible. Often, the event is generated when one of the component's ancestors is moved, becomes visible, or becomes invisible. The inherited getID() method returns the type of the event, which is one of the constants defined by the class. ANCESTOR_ADDED is used when the component becomes visible, and ANCESTOR_REMOVED is used when the component becomes invisible. getAncestor() returns the ancestor component that was modified, and, as a convenience, getAncestorParent() returns the parent of that ancestor. getComponent() is a synonym for the inherited getSource() method, except that it casts its return value to a JComponent.
Hierarchy: Object-->java.util.EventObject(Serializable)-->java.awt.AWTEvent-->AncestorEvent Passed To: AncestorListener.{ancestorAdded(), ancestorMoved(), ancestorRemoved()}
This interface defines the methods that must be implemented by an object that wants to receive notification when a JComponent is moved (with ancestorMoved()), made visible (ancestorAdded()),or made invisible (ancestorRemoved()).
Hierarchy: (AncestorListener(java.util.EventListener)) Passed To: JComponent.{addAncestorListener(), removeAncestorListener()}
This event is generated by JTextComponent and its subclasses JTextField, JTextArea, JTextPane, and JEditorPane when the caret position changes. The text caret maintains both the current insertion position (the dot) and a marker position (the mark). A CaretEvent is generated when either position changes. The changed values can be obtained with getDot() and getMark(), respectively. The text component that contains the caret can be queried with the inherited getSource() method.
Hierarchy: Object-->java.util.EventObject(Serializable)-->CaretEvent Passed To: CaretListener.caretUpdate(), javax.swing.text.JTextComponent.fireCaretUpdate(), javax.swing.text.JTextComponent.AccessibleJTextComponent.caretUpdate()
This interface defines a method that an object must implement if it wants to receive notification when the caret position changes in a JTextComponent or one of its subclasses.
Hierarchy: (CaretListener(java.util.EventListener)) Implementations: javax.swing.text.JTextComponent.AccessibleJTextComponent Passed To: javax.swing.text.JTextComponent.{addCaretListener(), removeCaretListener()}
This interface defines the methods that must be implemented by an object that wants to receive notification of state changes in a javax.swing.CellEditor. Note that these methods are passed a ChangeEvent; there is no special CellEditorEvent type.
Hierarchy: (CellEditorListener(java.util.EventListener)) Implementations: JTable, JTable.AccessibleJTable Passed To: CellEditor.{addCellEditorListener(), removeCellEditorListener()}, DefaultCellEditor.{addCellEditorListener(), removeCellEditorListener()}, javax.swing.tree.DefaultTreeCellEditor.{addCellEditorListener(), removeCellEditorListener()}
This class is a generic event type that is generated by many Swing components to indicate that something has changed within the component. ChangeEvent does not contain any fields to indicate the type of the change; the type of state change should be implicit in the event listener to which the ChangeEvent object is passed. The only state maintained by ChangeEvent is the component that generated the event (returned by the inherited getSource() method). Because ChangeEvent is immutable and effectively stateless, Swing components can reuse a single shared ChangeEvent object for all their state changes, instead of allocating an event object for every change.
Hierarchy: Object-->java.util.EventObject(Serializable)-->ChangeEvent Passed To: Too many methods to list. Type Of: AbstractButton.changeEvent, DefaultBoundedRangeModel.changeEvent, DefaultButtonModel.changeEvent, DefaultCellEditor.changeEvent, DefaultSingleSelectionModel.changeEvent, JProgressBar.changeEvent, JSlider.changeEvent, JTabbedPane.changeEvent, MenuSelectionManager.changeEvent, javax.swing.colorchooser.DefaultColorSelectionModel.changeEvent, javax.swing.table.DefaultTableColumnModel.changeEvent, javax.swing.text.DefaultCaret.changeEvent, javax.swing.text.StyleContext.NamedStyle.changeEvent
This interface defines the method that an object must implement to receive notifications of state change events in Swing components.
Hierarchy: (ChangeListener(java.util.EventListener)) Implementations: AbstractButton.ButtonChangeListener, JMenuItem.AccessibleJMenuItem, JScrollPane.AccessibleJScrollPane, JTabbedPane.AccessibleJTabbedPane, JTabbedPane.ModelListener Passed To: Too many methods to list. Returned By: AbstractButton.createChangeListener(), JProgressBar.createChangeListener(), JSlider.createChangeListener(), JTabbedPane.createChangeListener() Type Of: AbstractButton.changeListener, JProgressBar.changeListener, JSlider.changeListener, JTabbedPane.changeListener
Events of this type are generated by a javax.swing.text.Document object when the document it represents changes. getDocument() returns the Document that was modified. getType() returns the type of the changes; its return value is one of the three constants defined by the DocumentEvent.EventType inner class. getOffset() returns the document coordinate of the start of the change, and getLength() returns the length of the change. getChange() returns a DocumentEvent.ElementChange object that describes the change in terms of its effect on the specified javax.swing.text.Element of the document.
Implementations: javax.swing.text.AbstractDocument.DefaultDocumentEvent Passed To: Too many methods to list.
This interface defines methods that provide information about changes to an javax.swing.text.Element object within a javax.swing.text.Document.
Implementations: javax.swing.text.AbstractDocument.ElementEdit Returned By: DocumentEvent.getChange(), javax.swing.text.AbstractDocument.DefaultDocumentEvent.getChange()
This class defines three type-safe object constants that are used to specify the type of a DocumentEvent.
Passed To: javax.swing.text.AbstractDocument.DefaultDocumentEvent.DefaultDocumentEvent() Returned By: DocumentEvent.getType(), javax.swing.text.AbstractDocument.DefaultDocumentEvent.getType() Type Of: DocumentEvent.EventType.{CHANGE, INSERT, REMOVE}
This interface defines the method that an object must implement in order to register for notifications of changes to a javax.swing.text.Document object.
Hierarchy: (DocumentListener(java.util.EventListener)) Implementations: javax.swing.text.JTextComponent.AccessibleJTextComponent Passed To: javax.swing.text.AbstractDocument.{addDocumentListener(), removeDocumentListener()}, javax.swing.text.DefaultStyledDocument.{addDocumentListener(), removeDocumentListener()}, javax.swing.text.Document.{addDocumentListener(), removeDocumentListener()}
This utility class is used by many Swing classes to maintain lists of event listeners. An EventListenerList maintains a list of event listener objects, possibly of several different types. In order to allow the type of each listener to be determined efficiently, EventListenerList also maintains the java.lang.Class object for each EventListener. The add() and remove() methods add and remove an event listener and its Class object to and from the list. When a component needs to send an event to all registered listeners of a given type, it calls getListenerList(). This method returns an array of objects, where the elements of this array are grouped in pairs. Each even-numbered element is a Class object that specifies the type of the event listener stored in the following odd-numbered element. Thus, you can quickly loop through the list of event listeners, comparing Class objects to find any registered listeners of the desired type. Objects that make use of EventListenerList must be careful not to modify the contents of the array returned by getListenerList().
Hierarchy: Object-->EventListenerList(Serializable) Type Of: Too many fields to list.
An event of this type is generated by JEditorPane when the user moves the mouse over, clicks on, or moves the mouse off a hypertext link. getURL() returns the URL of the hyperlink. getEventType() returns an object constant indicating what was done to the hyperlink. The inherited getSource() method returns the JEditorPane that contains the hyperlink.
Hierarchy: Object-->java.util.EventObject(Serializable)-->HyperlinkEvent Subclasses: javax.swing.text.html.HTMLFrameHyperlinkEvent Passed To: JEditorPane.fireHyperlinkUpdate(), HyperlinkListener.hyperlinkUpdate()
This class defines three type-safe object constants that are used to specify the type of a HyperlinkEvent.
Passed To: HyperlinkEvent.HyperlinkEvent(), javax.swing.text.html.HTMLFrameHyperlinkEvent.HTMLFrameHyperlinkEvent() Returned By: HyperlinkEvent.getEventType() Type Of: HyperlinkEvent.EventType.{ACTIVATED, ENTERED, EXITED}
This interface defines the method that an object must implement in order to register for notifications about hyperlink activity in a JEditorPane component.
Hierarchy: (HyperlinkListener(java.util.EventListener)) Passed To: JEditorPane.{addHyperlinkListener(), removeHyperlinkListener()}
This class is an empty implementation of InternalFrameListener. It is usually easier to extend this class than it is to implement InternalFrameListener from scratch.
Hierarchy: Object-->InternalFrameAdapter(InternalFrameListener(java.util.EventListener))
Events of this type are generated when a JInternalFrame component changes state. An InternalFrameEvent is very similar to the java.awt.event.WindowEvent generated when a native window (such as a JFrame or JDialog) changes state. The inherited getSource() method returns the JInternalFrame object that generated the event. The inherited getID() method returns the type of the event; this return value is one of the constants defined by this class. The meanings of these constants are mostly straightforward. Note the distinction between INTERNAL_FRAME_CLOSING and INTERNAL_FRAME_CLOSED, however. The first type of event is generated when the user requests that the JInternalFrame be closed. The program may respond by hiding or destroying the window (it is poor style to ignore this type of event). The second type of event is generated only after the internal frame is actually hidden or destroyed.
Hierarchy: Object-->java.util.EventObject(Serializable)-->java.awt.AWTEvent-->InternalFrameEvent Passed To: InternalFrameAdapter.{internalFrameActivated(), internalFrameClosed(), internalFrameClosing(), internalFrameDeactivated(), internalFrameDeiconified(), internalFrameIconified(), internalFrameOpened()}, InternalFrameListener.{internalFrameActivated(), internalFrameClosed(), internalFrameClosing(), internalFrameDeactivated(), internalFrameDeiconified(), internalFrameIconified(), internalFrameOpened()}
This class defines the methods that an object must implement to receive notifications about state changes in a JInternalFrame. See InternalFrameEvent for a discussion of the difference between internalFrameClosed() and internalFrameClosing(). It is usually easier to subclass InternalFrameAdapter than to implement this interface from scratch.
Hierarchy: (InternalFrameListener(java.util.EventListener)) Implementations: InternalFrameAdapter Passed To: JInternalFrame.{addInternalFrameListener(), removeInternalFrameListener()}
An event of this type is generated by a javax.swing.ListModel when the contents of the model changes. getType() returns one of the three constants defined by the class, to indicate the type of change that occurred. The inherited getSource() method returns the ListModel object that changed. getIndex0() and getIndex1() return the end points of the modified interval.
Hierarchy: Object-->java.util.EventObject(Serializable)-->ListDataEvent Passed To: JComboBox.{contentsChanged(), intervalAdded(), intervalRemoved()}, JList.AccessibleJList.{contentsChanged(), intervalAdded(), intervalRemoved()}, ListDataListener.{contentsChanged(), intervalAdded(), intervalRemoved()}
This interface defines the methods that must be implemented by an object to receive notifications of changes to the contents of a javax.swing.ListModel.
Hierarchy: (ListDataListener(java.util.EventListener)) Implementations: JComboBox, JList.AccessibleJList Passed To: AbstractListModel.{addListDataListener(), removeListDataListener()}, ListModel.{addListDataListener(), removeListDataListener()}
An event of this type is generated by a JList component or its underlying ListSelectionModel object to indicate a change in the current list selection. getFirstIndex() and getLastIndex() return the first and last elements in the list that may have had their selection state changed. The ListSelectionEvent does not contain the new selection state; you must query the JList or ListSelectionModel for that information. (Use the inherited getSource() method to obtain the source of the event). getValueIsAdjusting() returns true if the event is one in a series of rapid-fire events, such as those that are generated when the user drags the mouse through a JList. Some programs may choose to ignore these rapid-fire events and wait for an event for which getValueIsAdjusting() returns false.
Hierarchy: Object-->java.util.EventObject(Serializable)-->ListSelectionEvent Passed To: JList.AccessibleJList.valueChanged(), JTable.{columnSelectionChanged(), valueChanged()}, JTable.AccessibleJTable.{columnSelectionChanged(), valueChanged()}, ListSelectionListener.valueChanged(), TableColumnModelListener.columnSelectionChanged(), javax.swing.table.DefaultTableColumnModel.{fireColumnSelectionChanged(), valueChanged()}, javax.swing.table.JTableHeader.columnSelectionChanged()
This interface defines the method that an object must implement in order to receive notifications of changes in the selection state of a JList or ListSelectionModel.
Hierarchy: (ListSelectionListener(java.util.EventListener)) Implementations: JList.AccessibleJList, JTable, JTable.AccessibleJTable, javax.swing.table.DefaultTableColumnModel Passed To: DefaultListSelectionModel.{addListSelectionListener(), removeListSelectionListener()}, JList.{addListSelectionListener(), removeListSelectionListener()}, ListSelectionModel.{addListSelectionListener(), removeListSelectionListener()}
JMenuItem sends events of this type to registered MenuDragMouseListener objects to signal that the mouse has entered or exited the menu item, that it is moving over the menu item, or that the user has released the mouse button over the menu item.
Hierarchy: Object-->java.util.EventObject(Serializable)-->java.awt.AWTEvent-->java.awt.event.ComponentEvent-->java.awt.event.InputEvent-->java.awt.event.MouseEvent-->MenuDragMouseEvent Passed To: JMenuItem.{fireMenuDragMouseDragged(), fireMenuDragMouseEntered(), fireMenuDragMouseExited(), fireMenuDragMouseReleased(), processMenuDragMouseEvent()}, MenuDragMouseListener.{menuDragMouseDragged(), menuDragMouseEntered(), menuDragMouseExited(), menuDragMouseReleased()}
This interface defines the methods that JMenuItem invokes on registered objects when the user drags the mouse into, over, or out of the menu item or releases the mouse button over the item.
Hierarchy: (MenuDragMouseListener(java.util.EventListener)) Passed To: JMenuItem.{addMenuDragMouseListener(), removeMenuDragMouseListener()}
Events of this type are generated by a JMenu component to indicate that the menu button has been selected or deselected. (When the menu attached to that button actually pops up or down, the JPopupMenu component generates a PopupMenuEvent.) The inherited getSource() method returns the JMenu object that generated the event. The type of the MenuEvent depends on which MenuListener method it is passed to.
Hierarchy: Object-->java.util.EventObject(Serializable)-->MenuEvent Passed To: MenuListener.{menuCanceled(), menuDeselected(), menuSelected()}
JMenuItem sends events of this type to registered MenuKeyListener objects when the user types a key over the menu item.
Hierarchy: Object-->java.util.EventObject(Serializable)-->java.awt.AWTEvent-->java.awt.event.ComponentEvent-->java.awt.event.InputEvent-->java.awt.event.KeyEvent-->MenuKeyEvent Passed To: JMenuItem.{fireMenuKeyPressed(), fireMenuKeyReleased(), fireMenuKeyTyped(), processMenuKeyEvent()}, MenuKeyListener.{menuKeyPressed(), menuKeyReleased(), menuKeyTyped()}
This interface defines the method that a JMenuItem invokes on registered listeners when the user types a key in the menu item.
Hierarchy: (MenuKeyListener(java.util.EventListener)) Passed To: JMenuItem.{addMenuKeyListener(), removeMenuKeyListener()}
This interface defines the methods that an object must implement in order to be notified when a JMenu button is selected or deselected or when a menu selection is canceled.
Hierarchy: (MenuListener(java.util.EventListener)) Passed To: JMenu.{addMenuListener(), removeMenuListener()}
This class is an empty implementation of MouseInputListener. It often is easier to subclass this class, overriding only the methods you are interested in, than it is to implement all the methods of java.awt.event.MouseMotionListener from scratch.
Hierarchy: Object-->MouseInputAdapter(MouseInputListener(java.awt.event.MouseListener(java.util.EventListener),java.awt.event.MouseMotionListener(java.util.EventListener)))
MouseInputListener combines into a single interface the methods of the closely related MouseListener and MouseMotionListener interfaces of the java.awt.event package. This interface is a simple utility that makes it easier to implement both MouseEvent listener interfaces at once.
Hierarchy: (MouseInputListener(java.awt.event.MouseListener(java.util.EventListener),java.awt.event.MouseMotionListener(java.util.EventListener))) Implementations: MouseInputAdapter
An event of this type is generated just before a JPopupMenu is popped up or popped down or when a JPopupMenu is canceled (i.e., when it is popped down without the user making a selection). The inherited getSource() method returns the JPopupMenu, but PopupMenuEvent contains no other state. The type of the event is determined by the PopupMenuListener method to which it is passed.
Hierarchy: Object-->java.util.EventObject(Serializable)-->PopupMenuEvent Passed To: PopupMenuListener.{popupMenuCanceled(), popupMenuWillBecomeInvisible(), popupMenuWillBecomeVisible()}
This interface defines the methods that an object must implement to receive notifications that a JPopupMenu is about to pop up or pop down or that a JPopupMenu was canceled without a user selection.
Hierarchy: (PopupMenuListener(java.util.EventListener)) Passed To: JPopupMenu.{addPopupMenuListener(), removePopupMenuListener()}
This utility class is useful when you are defining a Swing component that has bound properties and must fire java.beans.PropertyChangeEvent events when the value of various properties change. This class is a subclass of java.beans.PropertyChangeSupport and provides the same features as that class. This Swing-specific version is somewhat more memory efficient than the JavaBeans version and does not use synchronized methods.
Hierarchy: Object-->java.beans.PropertyChangeSupport(Serializable)-->SwingPropertyChangeSupport Type Of: AbstractAction.changeSupport, javax.swing.tree.DefaultTreeSelectionModel.changeSupport
An event of this type is generated when a column is added, deleted, or moved from a javax.swing.table.TableColumnModel. The inherited getSource() method returns the TableColumnModel object that was changed. When a column is added, getToIndex() specifies the index of the column. When a column is removed, getFromIndex() specifies the index that it used to occupy. When a column is moved, getFromIndex() returns the column's old position and getToIndex() returns the column's new position.
Hierarchy: Object-->java.util.EventObject(Serializable)-->TableColumnModelEvent Passed To: JTable.{columnAdded(), columnMoved(), columnRemoved()}, JTable.AccessibleJTable.{columnAdded(), columnMoved(), columnRemoved()}, TableColumnModelListener.{columnAdded(), columnMoved(), columnRemoved()}, javax.swing.table.DefaultTableColumnModel.{fireColumnAdded(), fireColumnMoved(), fireColumnRemoved()}, javax.swing.table.JTableHeader.{columnAdded(), columnMoved(), columnRemoved()}
This interface defines the methods that an object must implement to receive notifications of changes in a javax.swing.table.TableColumnModel. Note that unlike most event listeners, the methods of this object are passed different types of event objects.
Hierarchy: (TableColumnModelListener(java.util.EventListener)) Implementations: JTable, JTable.AccessibleJTable, javax.swing.table.JTableHeader Passed To: javax.swing.table.DefaultTableColumnModel.{addColumnModelListener(), removeColumnModelListener()}, javax.swing.table.TableColumnModel.{addColumnModelListener(), removeColumnModelListener()}
An event of this type is generated by a javax.swing.table.TableModel when the data it contains changes. getColumn() indicates the column that changed; it may return the constant ALL_COLUMNS. getFirstRow() and getLastRow() get the range of modified rows. If either returns the constant HEADER_ROW, that indicates that the entire structure of the table has changed along with the table data. getType() specifies the type of the change; it returns one of the constants DELETE, INSERT, or UPDATE. The inherited getSource() method returns the modified TableModel object.
Hierarchy: Object-->java.util.EventObject(Serializable)-->TableModelEvent Passed To: JTable.tableChanged(), JTable.AccessibleJTable.{tableChanged(), tableRowsDeleted(), tableRowsInserted()}, TableModelListener.tableChanged(), javax.swing.table.AbstractTableModel.fireTableChanged(), javax.swing.table.DefaultTableModel.{newDataAvailable(), newRowsAdded(), rowsRemoved()}
This interface defines the method that an object must implement to receive notifications about changes to the state of a javax.swing.table.TableModel.
Hierarchy: (TableModelListener(java.util.EventListener)) Implementations: JTable, JTable.AccessibleJTable Passed To: javax.swing.table.AbstractTableModel.{addTableModelListener(), removeTableModelListener()}, javax.swing.table.TableModel.{addTableModelListener(), removeTableModelListener()}
An event of this type is generated by a JTree component when a node in the tree is expanded or collapsed. The inherited getSource() method returns the JTree component, and getPath() returns a TreePath that specifies which node was expanded or collapsed.
Hierarchy: Object-->java.util.EventObject(Serializable)-->TreeExpansionEvent Passed To: JTree.AccessibleJTree.{treeCollapsed(), treeExpanded()}, TreeExpansionListener.{treeCollapsed(), treeExpanded()}, TreeWillExpandListener.{treeWillCollapse(), treeWillExpand()}, javax.swing.tree.ExpandVetoException.ExpandVetoException() Type Of: javax.swing.tree.ExpandVetoException.event
This interface defines the methods that an object must implement to be notified when a JTree component expands or collapses a node.
Hierarchy: (TreeExpansionListener(java.util.EventListener)) Implementations: JTree.AccessibleJTree Passed To: JTree.{addTreeExpansionListener(), removeTreeExpansionListener()}
An event of this type is generated when the contents of a java.awt.event.tree.TreeModel change. The inherited getSource() method returns the TreeModel object that was changed. getPath() and getTreePath() specify the path to the parent of the changed nodes. getChildIndices() returns an array of integers that specifies which children of that parent node have changed. Alternatively, getChildren() returns the modified children directly. TreeModelEvent does not directly indicate what type of change has occurred; that is determined by the TreeModelListener method to which the TreeModelEvent is passed.
Hierarchy: Object-->java.util.EventObject(Serializable)-->TreeModelEvent Passed To: Too many methods to list.
This interface defines the methods that an object must implement to receive notifications of changes to a javax.swing.tree.TreeModel.
Hierarchy: (TreeModelListener(java.util.EventListener)) Implementations: JTree.AccessibleJTree, JTree.TreeModelHandler Passed To: javax.swing.tree.DefaultTreeModel.{addTreeModelListener(), removeTreeModelListener()}, javax.swing.tree.TreeModel.{addTreeModelListener(), removeTreeModelListener()} Returned By: JTree.createTreeModelListener() Type Of: JTree.treeModelListener
An event of this type is generated by a javax.swing.tree.TreeSelectionModel or by the JTree component that uses that model when the selection state of the tree changes. getPaths() returns the array of javax.swing.tree.TreePath objects that were added to or removed from the selection. getPath() returns the first element of this array. The one-argument version of isAddedPath() tests whether a specified TreePath (it must be one of the ones returned by getPaths()) was added to the selection (true) or removed from it (false). The no-argument version of this method tests whether the value returned by getPath() was selected or deselected.
Hierarchy: Object-->java.util.EventObject(Serializable)-->TreeSelectionEvent Passed To: JTree.fireValueChanged(), JTree.AccessibleJTree.valueChanged(), JTree.TreeSelectionRedirector.valueChanged(), TreeSelectionListener.valueChanged(), javax.swing.tree.DefaultTreeCellEditor.valueChanged(), javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged()
This interface defines the method that an object must implement to receive notifications about changes to the selection state of a javax.swing.tree.TreeSelectionModel object or JTree component.
Hierarchy: (TreeSelectionListener(java.util.EventListener)) Implementations: JTree.AccessibleJTree, JTree.TreeSelectionRedirector, javax.swing.tree.DefaultTreeCellEditor Passed To: JTree.{addTreeSelectionListener(), removeTreeSelectionListener()}, javax.swing.tree.DefaultTreeSelectionModel.{addTreeSelectionListener(), removeTreeSelectionListener()}, javax.swing.tree.TreeSelectionModel.{addTreeSelectionListener(), removeTreeSelectionListener()}
This interface defines the methods that JTree invokes on registered listeners immediately before it expands or collapses a node. Do not confuse this interface with TreeExpansionListener, which is notified immediately after a node is expanded or collapsed. Both listeners share the same TreeExpansionEvent event type, however. Note that the methods of this interface can throw an ExpandVetoException to veto the proposed expansion or collapse of the node.
Hierarchy: (TreeWillExpandListener(java.util.EventListener)) Passed To: JTree.{addTreeWillExpandListener(), removeTreeWillExpandListener()}
An event of this type is generated by a javax.swing.text.Document when an undoable edit has occurred. The inherited getSource() method returns the Document object on which the edit occurred, and getEdit() returns a description of the edit itself.
Hierarchy: Object-->java.util.EventObject(Serializable)-->UndoableEditEvent Passed To: UndoableEditListener.undoableEditHappened(), javax.swing.text.AbstractDocument.fireUndoableEditUpdate(), javax.swing.text.html.HTMLDocument.fireUndoableEditUpdate(), javax.swing.undo.UndoManager.undoableEditHappened()
This interface defines the method that an object must implement in order to receive notifications when an undoable edit occurs in a javax.swing.text.Document.
Hierarchy: (UndoableEditListener(java.util.EventListener)) Implementations: javax.swing.undo.UndoManager Passed To: javax.swing.text.AbstractDocument.{addUndoableEditListener(), removeUndoableEditListener()}, javax.swing.text.Document.{addUndoableEditListener(), removeUndoableEditListener()}, javax.swing.undo.UndoableEditSupport.{addUndoableEditListener(), removeUndoableEditListener()} Copyright © 2001 O'Reilly & Associates. All rights reserved. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|