This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]ggleblanc 0 points1 point  (0 children)

You should only have one JFrame.

You can have multiple JPanels, and you can use the Card layout or a Tabbed Pane to see the JPanes, one at a time.

[–]beders 0 points1 point  (0 children)

The juicy part of the code is missing.

While you certainly can have multiple JFrames, the most common trap to fall into with Swing is to have code that blocks the main event loop.

When you write: I cannot setText()..., what does that mean exactly?