0

I'm trying to do a little project, but I'm block. What I want to do is when I press a button, the bottom-east panel change (look at the screen). I'm doing it in the MVC schema.

enter image description here

Actually, I did that :

I created a global panel (initGlobalPanel), when I put into it 6 other panels. I tried that with a CardLayout + ActionListener but still don't work.

My code is pretty long, I'm posting it if you want, but I'm sure that there is an easier way to do that.

nitind
  • 19,089
  • 4
  • 34
  • 43
IsmaElzem
  • 109
  • 10
  • 3
    You will need to reduce your code so you can post it here in a [mcve]. – daniu Aug 28 '18 at 09:25
  • 1
    You have to make visibility true for another panel and visibility for current panel to false. This what we do if we have to lunch another panel and make same current panel to disappear. – Simmant Aug 28 '18 at 09:34
  • Well, the problem is @daniu that I can't cut something to make it minimal.. Do you guys has an example to how to use it ? I have for now 2 panels I want to swap between them if we push 2 differents button. – IsmaElzem Aug 28 '18 at 09:39
  • Take a look at this example: https://stackoverflow.com/questions/14821952/changing-panels-using-the-card-layout if it doesn't apply to your project, attach your code at https://paste.ofcode.org –  J.Kennsy Aug 28 '18 at 09:49

0 Answers0