311 * the menu component.
312 */
313 public void removeNotify() {
314 synchronized (getTreeLock()) {
315 MenuComponentPeer p = this.peer;
316 if (p != null) {
317 Toolkit.getEventQueue().removeSourceEvents(this, true);
318 this.peer = null;
319 p.dispose();
320 }
321 }
322 }
323
324 /**
325 * Posts the specified event to the menu.
326 * This method is part of the Java 1.0 event system
327 * and it is maintained only for backwards compatibility.
328 * Its use is discouraged, and it may not be supported
329 * in the future.
330 * @param evt the event which is to take place
331 * @deprecated As of JDK version 1.1, replaced by {@link
332 * #dispatchEvent(AWTEvent) dispatchEvent}.
333 */
334 @Deprecated
335 public boolean postEvent(Event evt) {
336 MenuContainer parent = this.parent;
337 if (parent != null) {
338 parent.postEvent(evt);
339 }
340 return false;
341 }
342
343 /**
344 * Delivers an event to this component or one of its sub components.
345 * @param e the event
346 */
347 public final void dispatchEvent(AWTEvent e) {
348 dispatchEventImpl(e);
349 }
350
|
311 * the menu component.
312 */
313 public void removeNotify() {
314 synchronized (getTreeLock()) {
315 MenuComponentPeer p = this.peer;
316 if (p != null) {
317 Toolkit.getEventQueue().removeSourceEvents(this, true);
318 this.peer = null;
319 p.dispose();
320 }
321 }
322 }
323
324 /**
325 * Posts the specified event to the menu.
326 * This method is part of the Java 1.0 event system
327 * and it is maintained only for backwards compatibility.
328 * Its use is discouraged, and it may not be supported
329 * in the future.
330 * @param evt the event which is to take place
331 * @return unconditionally returns false
332 * @deprecated As of JDK version 1.1, replaced by {@link
333 * #dispatchEvent(AWTEvent) dispatchEvent}.
334 */
335 @Deprecated
336 public boolean postEvent(Event evt) {
337 MenuContainer parent = this.parent;
338 if (parent != null) {
339 parent.postEvent(evt);
340 }
341 return false;
342 }
343
344 /**
345 * Delivers an event to this component or one of its sub components.
346 * @param e the event
347 */
348 public final void dispatchEvent(AWTEvent e) {
349 dispatchEventImpl(e);
350 }
351
|