k9b
k9b

Reputation: 1493

JFrame multiple screens

I have been programming in Android and I switch between specific screens using intents. I have always wondered how to do this in Java, when I click a button switch to a different screen. Is there a way to specify multiple JFrames or would I have to delete all of the objects off one frame and then add some?

Upvotes: 3

Views: 1978

Answers (1)

Jonas
Jonas

Reputation: 128807

You can use CardLayout for "switching content". See How to use CardLayout.

And instead of Intents in Android, you should use Action in Java Swing. See How to use Actions.

Upvotes: 7

Related Questions