1

I am developing a math game and I was thinking about displaying the data like so:

  1. Display the data that the user is to screencap and send to me, in a JFrame. This data will be displayed in the form of two JTabbedPanes, each tab showing a table (with five rows and 8 columns)
  2. Ask the user (via JOptionPane.showConfirmDialog()) if they would like to see a graphical representation of their progress.
  3. If they click "Yes", then show them a JFrame with their chart. This JFrame will have a JMenuBar with only one JMenu with two JMenuItems (an option for both of the two modes).
  4. In this new JFrame, display via CardLayout the active JTabbedPane (the FloatMode has four difficulties, while the IntMode has all the FloatMode's difficulties plus Elementary School difficulty.

I know that multiple JFrames can be bad practice, and I was thinking about using JSplitPanes, but then it might get too crowded (and I wouldn't be able to let the users choose the mode!). Would a JDialog be recommended, or would you recommend something else? //I apologize if it sounds like I am asking you all to do some of my thinking for me...

Community
  • 1
  • 1
Mike Warren
  • 3,796
  • 5
  • 47
  • 99

2 Answers2

1

Seems best suited to a CardLayout with a single control to select between cards (e.g. a JList or JComboBox, JSpinner, menus etc.).

E.G. as seen in this short example, that uses radio buttons in a button group to select the card.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
0

I might have a potential solution: make the JMenuBar universal! That would eliminate the need for two JTabbedPanes and thus speed up performance (due to less Objects floating around, especially expensive GUI Objects)!

Mike Warren
  • 3,796
  • 5
  • 47
  • 99
  • of course, I would need an uneditable JTabbedPane (or maybe a popup help) stating that the table is only for one mode. I could take this even further by adding a "Help" `JMenu` with only one `JMenuItem`. – Mike Warren Jun 24 '13 at 22:45
  • Also, it seems that only the `JTabbedPane` shows. //I have tried making an example where I have both a `JTabbedPane` and a `JScrollPane` (with a `JTable` in it) inside a JPanel. Why is this so? – Mike Warren Jun 27 '13 at 19:17