101 |
} |
} |
102 |
|
|
103 |
/** |
/** |
104 |
* DOCUMENT ME! |
* Creates ChangeListener |
105 |
* |
* |
106 |
* @return DOCUMENT ME! |
* @return The ChangeListener |
107 |
*/ |
*/ |
108 |
protected ChangeListener createChangeListener() |
protected ChangeListener createChangeListener() |
109 |
{ |
{ |
112 |
|
|
113 |
/** |
/** |
114 |
* Creates ContainerListener() to listen for ContainerEvents |
* Creates ContainerListener() to listen for ContainerEvents |
115 |
* fired by JMenuBar |
* fired by JMenuBar. |
116 |
* |
* |
117 |
* @return The ContainerListener |
* @return The ContainerListener |
118 |
*/ |
*/ |
242 |
} |
} |
243 |
|
|
244 |
/** |
/** |
245 |
* DOCUMENT ME! |
* Unregisters all the listeners that this UI delegate was using. |
246 |
*/ |
*/ |
247 |
protected void uninstallListeners() |
protected void uninstallListeners() |
248 |
{ |
{ |
273 |
} |
} |
274 |
|
|
275 |
/** |
/** |
276 |
* This class handles ContainerEvents fired by JMenuBar |
* This class handles ContainerEvents fired by JMenuBar. It revalidates |
277 |
|
* and repaints menu bar whenever menu is added or removed from it. |
278 |
*/ |
*/ |
279 |
protected class ContainerHandler implements ContainerListener |
protected class ContainerHandler implements ContainerListener |
280 |
{ |
{ |
285 |
*/ |
*/ |
286 |
public void componentAdded(ContainerEvent e) |
public void componentAdded(ContainerEvent e) |
287 |
{ |
{ |
288 |
System.out.println("BasicMenuBar...componentAdded.. listener"); |
menuBar.revalidate(); |
289 |
|
menuBar.repaint(); |
290 |
} |
} |
291 |
|
|
292 |
/** |
/** |
293 |
* This method is called whenever menu is removed from the menu bar |
* This method is called whenever menu is removed from the menu bar. |
294 |
* |
* |
295 |
* @param e The ContainerEvent. |
* @param e The ContainerEvent. |
296 |
*/ |
*/ |
297 |
public void componentRemoved(ContainerEvent e) |
public void componentRemoved(ContainerEvent e) |
298 |
{ |
{ |
299 |
System.out.println("BasicMenuBar...componentRemoved.. listener"); |
menuBar.revalidate(); |
300 |
|
menuBar.repaint(); |
301 |
} |
} |
302 |
} |
} |
303 |
|
|
316 |
{ |
{ |
317 |
if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY)) |
if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY)) |
318 |
menuBar.repaint(); |
menuBar.repaint(); |
319 |
|
if (e.getPropertyName().equals(JMenuBar.MARGIN_CHANGED_PROPERTY)) |
320 |
|
menuBar.repaint(); |
321 |
} |
} |
322 |
} |
} |
323 |
} |
} |