-4

Could someone tell me how to do this? Ive tried by putting the element1.setVisible(true) in actionListener but it does nothing.

msrd0
  • 7,816
  • 9
  • 47
  • 82
user1232112
  • 35
  • 1
  • 7

1 Answers1

1

If element1 was added after the initial calls to pack() and set visible(), you will have to revalidate(), and possibly repaint(), the enclosing container. A more extensive examination of the problem is seen here.

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