Hi Peter,

you attempted to use a member from outer class in the anonymous class new
ActionListener(). That doesn't work.
You can modify it like:

  final Button button1 = new Button("Stop");
  button1.addActionListener( new ActionListener() {
  public void actionPerformed(ActionEvent e)
  {
     //call to outer class method
     processAction();
  });

//method in outer class
private void processAction()
{
     scene.removeChild();
}

Gernot
[EMAIL PROTECTED]




                    SUBSCRIBE
                    JAVA3D-INTEREST             To:     [EMAIL PROTECTED]
                    peter                       cc:
                    <siujeanman@HOTMAIL.        Subject:     [JAVA3D] how to solve 
that problem
                    COM>
                    Sent by: Discussion
                    list for Java 3D API
                    <JAVA3D-INTEREST@JAV
                    A.SUN.COM>


                    15.02.00 11:39
                    Please respond to
                    Discussion list for
                    Java 3D API






dear all:
 i have created a button and when it was pressed, a child under a BG will
reomve.and the coding like below:

  final Button button1 = new Button("Stop");
  button1.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent e)
            {
             scene.removeChild(1);
             }
    );

where scene is a Group or BG.But when compile , it show the error message
"Attemptto use a non-final variable scen from a different method,From
enclosing blocks,only final local variable are available"

Can anyone help me!Urengy.And need the whole source coding to take a
look,pls tell me.thx..

===========================================================================
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