Hi,

The problem is in your processEvent function which you didn't send, so this answer is a
guess.

When your function is passed an event e, that event may be null. So before you do
e.anyfunction() you have to do an if (e != null)

Why java (java3d?) sends these null events is a mystery to me, but checking for null
may solve your problem.

From,

Greg



SUBSCRIBE JAVA3D-INTEREST peter wrote:

> dear all
> i had created a button that is used to remove a BG child when the button is pressed.
>
>   final Button button1 = new Button("Stop");
>   button1.addActionListener( new ActionListener() {
>   public void actionPerformed(ActionEvent e)
>   {
>     processAction();
>   });
>
> private void processAction()
> {
>      scene.removeChild();
> }
>  And when compile , it is no error. but when run, when i press the
> button
> it show the error like below
>
> "Exception occured during event dispatching:
>  java.lang.NullPointerException:
>    at Test.processAction (Test.java:876)
>    at Test.processEvent(button.java,compiled code);
>    at java.awt.Button.processActionEvent(Button.java:308)
>    at java.awt.Button.processEvent(Button.java:281)
>    at java .awt.EventQuene.dispatcheveny(eventquene.java,compile code);
> ....
> "
> can anyone help me? ugrency
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to