0

i'm trying to overlap two different JPanels on a single JFrame. How can i do that? I have a GamePanel where i draw my game, and a BorderPanel, that draws a border for my game. BorderPanel is to expose the enemies and other objects of the game just after crossing the border. The border then must always be on the surface. Is it possible?

Alessandro
  • 75
  • 1
  • 1
  • 5
  • While technically there are some options (involving questionable techniques like transparent panels and `null`-layouts, or a `JLayeredPane`), I wonder why you are having a dedicated panel for the border. Why not paint the enemies in the GamePanel ... at the border? – Marco13 Mar 30 '14 at 13:48
  • Have you looked at the CardLayout Manager? – Tdorno Mar 30 '14 at 13:58
  • @Marco13 i have a dedicated panel for the border beacause I don't want that enemies or other game objects could overlap the border...the border must be on the surface. – Alessandro Mar 30 '14 at 14:24

0 Answers0