Hi,

I'm having trouble with java applications. I'm hoping that some-one can help me with my program.
I read in the beginning that stupid questions are OK here, so I'm realy at ease to ask this question now ...

I know that java is multi-threading and multi-tasking and I've had a basic java training, so I can understand some of the more difficult things in java. I want to make an AWT application with a menubar. In that menubar is a button with "NEW" as label. The user should be able to instanciate this application again, lets say open it again. I've got it working like this:

import java.awt.*;
import java.awt.event.*;

public class Application1 extends Frame{
// declarations go here
public static void main(String[] args){
new Application1();
}
public Application1(){
// stuff in the program goes here
}
// other stuf goes here, like handlers for the menu
}
// end of program

Now I've got an windowhandler so when you click on the close button that the window will close.
And then I've got the "NEW" button like this:

private class menuhandler implements ActionListener{
public void actionPerformed(ActionEvent e){
if(e.getSource()==nieuwItem) new Sudoku1();
}
}
// end of java code

So the program makes another instance of the CLASS, and I can do this multiple times while they all interact with the user seperately. So I would say its all OK. But when I press the close button, then it closes all of the windows ...
I also get only one dos-window, while I need to have as many as there are instances.

Can some-one save me from my misery? And explain to me what I did wrong and what I did do with this instruction (this instruction must do something, but its not what I hoped). And maybe give the solution to my problem as well.

Thanks to all who helps me ... Bye !