0

Brief overview of my program: records statistics about a local football team such as goals, assists etc for each player in the team. The team will consist of 20 players at most.

The program needs to create new pages when a new player is added to the team. Currently I am using jFrames for pages and do not know how to automatically create new jFrames from within a jFrame. The new pages also need to have a structure e.g. title, text boxes (could this be done using a template of some sort?).

I do not know how to accomplish this..

Thanks

1 Answers1

3

I do not know how to accomplish this..

Currently I am using jFrames for pages and do not know how to automatically create new jFrames from within a jFrame.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • mKorbel is correct, but you may be able to leverage the approach outlined [here](http://stackoverflow.com/a/2561540/2305130). – trashgod Feb 02 '14 at 21:36
  • I had a look and tried the code [outlined](http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html) mostly successfully. I'm having difficulty calling the command addToComponent from a jFrame. My command calling code: `JPanel A = new JPanel() { @Override public Dimension getPreferredSize() { return new Dimension(200, 200); } }; CardLayoutClass CLC = new CardLayoutClass(); CLC.AddComponentToPane(A); A.setLayout(new java.awt.BorderLayout()); A.setVisible(true); A.setSize(300, 300);` Result = blank frame –  Feb 03 '14 at 22:23
  • no idea about what is your code posted here, see [CardLayout](http://stackoverflow.com/a/8371896/714968), or [CardLayout here](http://stackoverflow.com/questions/tagged/cardlayout), or re_read Oracle tutorial linked in my answer – mKorbel Feb 03 '14 at 22:43