-2

Right, so I already looked at multiple questions regarding something close to this but not what I need help with.

What my issue is, what would I call so that when "New" is clicked, a new Frame would open (the same but just opened again). The system prints out the string, so I know it's working. I just need to figure out how to open a new window.

 mntmNew.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                System.out.println("Opening a new window.");

            }
        });
roeygol
  • 4,908
  • 9
  • 51
  • 88
Carbs
  • 9
  • 1
  • 3
    How did you show the first window? You should be able to use the same code if you got it to display once. – takendarkk Jan 18 '15 at 01:13
  • It's exactly the same as how you'd open and create **any** JFrame. Surely you can extrapolate from this, no? And regarding, `"Right, so I already looked at multiple questions regarding something close to this but not what I need help with."` -- you will want to work on those search skills, and in fact please understand that you can search this site: [check this search result](http://stackoverflow.com/search?q=%5Bjava%5D+open+new+jframe). – Hovercraft Full Of Eels Jan 18 '15 at 01:14
  • 1
    Also, please have a look at [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice) – Hovercraft Full Of Eels Jan 18 '15 at 01:21

1 Answers1

0
YourJFrameClass frame = new YourJFrameClass();
frame.<function to show it>();

then you will maybe make it modal or close the previous one.

roeygol
  • 4,908
  • 9
  • 51
  • 88