1

I am programming a gui in java and it has some buttons one of these buttons is options. I would like to have it so when you click on options it changes the gui to my options gui instead of opening it in another window.

How can I do this?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
jman
  • 11
  • 2
  • i am not sure what gui kit u are using, but if u are using swing, its as simple as replacing your old panel with new panel in the parent contianer – Suraj Chandran Sep 04 '11 at 16:45

1 Answers1

6

CardLayout, seen here, is a good choice. Alternatively, you can just remove() and revalidate(), as shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045