Package com.jidesoft.swing
Class PopupWindow
java.lang.Object
com.jidesoft.swing.PopupWindow
PopupWindow class
You can add another JPopupMenu or JComboxBox in this popup.
This class is copied from http://forum.java.sun.com/thread.jsp?forum=57&thread=230866 with some minor modifications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EventListenerList
A list of event listeners for this component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
PopupWindow will add necessary listeners to some components so that mouse click etc can hide the popup window.void
Adds aPopupMenu
listener which will listen to notification messages from the popup portion of the combo box.void
NotifiesPopupMenuListener
s that the popup portion of the combo box has been canceled.void
NotifiesPopupMenuListener
s that the popup portion of the combo box has become invisible.void
NotifiesPopupMenuListener
s that the popup portion of the combo box will become visible.Returns an array of all thePopupMenuListener
s added to this JComboBox with addPopupMenuListener().void
hide()
boolean
isExcludedComponent
(Component comp) boolean
Gets the visibility of this popup.void
void
Removes aPopupMenuListener
.void
-
Field Details
-
listenerList
A list of event listeners for this component.
-
-
Constructor Details
-
PopupWindow
-
-
Method Details
-
add
-
show
-
hide
public void hide() -
isVisible
public boolean isVisible()Gets the visibility of this popup.- Returns:
- true if popup is visible
-
addPopupMenuListener
Adds aPopupMenu
listener which will listen to notification messages from the popup portion of the combo box. For all standard look and feels shipped with Java 2, the popup list portion of combo box is implemented as aJPopupMenu
. A custom look and feel may not implement it this way and will therefore not receive the notification.- Parameters:
l
- thePopupMenuListener
to add- Since:
- 1.4
-
removePopupMenuListener
Removes aPopupMenuListener
.- Parameters:
l
- thePopupMenuListener
to remove- Since:
- 1.4
- See Also:
-
getPopupMenuListeners
Returns an array of all thePopupMenuListener
s added to this JComboBox with addPopupMenuListener().- Returns:
- all of the
PopupMenuListener
s added or an empty array if no listeners have been added - Since:
- 1.4
-
firePopupMenuWillBecomeVisible
public void firePopupMenuWillBecomeVisible()NotifiesPopupMenuListener
s that the popup portion of the combo box will become visible. This method is public but should not be called by anything other than the UI delegate.- Since:
- 1.4
- See Also:
-
firePopupMenuWillBecomeInvisible
public void firePopupMenuWillBecomeInvisible()NotifiesPopupMenuListener
s that the popup portion of the combo box has become invisible. This method is public but should not be called by anything other than the UI delegate.- Since:
- 1.4
- See Also:
-
firePopupMenuCanceled
public void firePopupMenuCanceled()NotifiesPopupMenuListener
s that the popup portion of the combo box has been canceled. This method is public but should not be called by anything other than the UI delegate.- Since:
- 1.4
- See Also:
-
addAsExcludedComponents
PopupWindow will add necessary listeners to some components so that mouse click etc can hide the popup window. However in certain case, you might not want this.- Parameters:
comp
- component which will not hide popup when it is clicked.
-
removeFromExcludedComponents
-
isExcludedComponent
-