#104 close internal frame error

open
nobody
GUI (21)
5
2003-01-15
2003-01-15
Anonymous
No

I use BeanShell 1.2b7. I write a java application to
display a JInternalFrame, and add a
InternalFrameListener to it using BeanShell.
the listener implementation code show below:
import javax.swing.event.InternalFrameListener;

internalFrameOpened(e) {
System.out.println("internal frame opened");
}
invoke(name, args) {}
return (InternalFrameListener)this;
I use the Interpreter.eval(String) to eval the above
code,and get a listener instance to add to internal frame.
but when I press the close button on the internal frame,
the below stack trace appear, who can help me?
[java] java.lang.NullPointerException
[java] at $Proxy4.equals(Unknown Source)
[java] at
javax.swing.event.EventListenerList.remove
(EventListenerList.
java:207)
[java] at
javax.swing.JInternalFrame.removeInternalFrameListener
(JInter
nalFrame.java:1476)
[java] at
javax.swing.plaf.basic.BasicInternalFrameUI$BasicIntern
alFram
eListener.internalFrameClosed
(BasicInternalFrameUI.java:1421)
[java] at
javax.swing.JInternalFrame.fireInternalFrameEvent
(JInternalFr
ame.java:1528)
[java] at javax.swing.JInternalFrame.dispose
(JInternalFrame.java:1756)
[java] at
javax.swing.JInternalFrame.doDefaultCloseAction
(JInternalFram
e.java:1589)
[java] at
javax.swing.plaf.basic.BasicInternalFrameTitlePane$Clos
eActio
n.actionPerformed(BasicInternalFrameTitlePane.java:528)
[java] at
javax.swing.AbstractButton.fireActionPerformed
(AbstractButton
.java:1764)
[java] at
javax.swing.AbstractButton$ForwardActionEvents.action
Performe
d(AbstractButton.java:1817)
[java] at
javax.swing.DefaultButtonModel.fireActionPerformed
(DefaultBut
tonModel.java:419)
[java] at
javax.swing.DefaultButtonModel.setPressed
(DefaultButtonModel.
java:257)
[java] at
javax.swing.plaf.basic.BasicButtonListener.mouseReleas
ed(Basi
cButtonListener.java:245)
[java] at
java.awt.AWTEventMulticaster.mouseReleased
(AWTEventMulticaste
r.java:227)
[java] at java.awt.Component.processMouseEvent
(Component.java:5093)
[java] at java.awt.Component.processEvent
(Component.java:4890)
[java] at java.awt.Container.processEvent
(Container.java:1566)
[java] at java.awt.Component.dispatchEventImpl
(Component.java:3598)
[java] at java.awt.Container.dispatchEventImpl
(Container.java:1623)
[java] at java.awt.Component.dispatchEvent
(Component.java:3439)
[java] at
java.awt.LightweightDispatcher.retargetMouseEvent
(Container.j
ava:3450)
[java] at
java.awt.LightweightDispatcher.processMouseEvent
(Container.ja
va:3165)
[java] at
java.awt.LightweightDispatcher.dispatchEvent
(Container.java:3
095)
[java] at java.awt.Container.dispatchEventImpl
(Container.java:1609)
[java] at java.awt.Window.dispatchEventImpl
(Window.java:1585)
[java] at java.awt.Component.dispatchEvent
(Component.java:3439)
[java] at java.awt.EventQueue.dispatchEvent
(EventQueue.java:450)
[java] at
java.awt.EventDispatchThread.pumpOneEventForHierarc
hy(EventDi
spatchThread.java:197)
[java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDisp
atchThread.java:150)
[java] at
java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.j
ava:144)
[java] at
java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.j
ava:136)
[java] at java.awt.EventDispatchThread.run
(EventDispatchThread.java:99)

Discussion

  • Pat Niemeyer
    Pat Niemeyer
    2003-06-27

    Logged In: YES
    user_id=18885

    This has probably been fixed in 1.3 w/a bug fix in the proxy
    implementing object protocol (equals() method). However I
    haven't had time to test it yet...