How to bring an image to the foreground in Java?

后端 未结 3 1909
盖世英雄少女心
盖世英雄少女心 2021-01-27 07:10

I\'m trying to create a Pacman game in Java, and so far I\'ve displayed the background image (the blue and black maze), but I\'m having trouble showing the image of Pacman. When

3条回答
  •  -上瘾入骨i
    2021-01-27 07:31

    Use a JLayeredPane insted of the window directly for a container and specify the depth (z-order) of the components when you add them.

提交回复
热议问题