Thanks, but still I can't do what I want.
I try like this, but have
public class JedApplet extends Applet {
JedApplet jedapplet public void init() {
// her comes code that create SimpleUniverse with Information=0, and
// whwn I clik with mouse on Button field, I have to put new
// SimpleUniverse with Information=1
paint(Information);
}
public void paint(int Information){
//adding something in the scene
}
public void redraw(int Information){
paint(Information);
}
public static void main(String[] args) {
Frame frame = new MainFrame(new JedApplet(), 500, 500);
}
}
class Controls extends Panel implements ActionListener {
Canvas3D c;
int Information;
JedApplet jedapplet; public Controls(Canvas3D c) {
Button b = null;
this.c = c;
b = new Button("Button");
b.addActionListener(this);
add(b);
}
public void actionPerformed(ActionEvent ev) {
String label = ev.getActionCommand();
Information =1;
jedapplet.redraw(Information); }
}
Most probably something is wrong with this bold one and giving me
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException in this last bold line of the code.