The bottom line is that I added a photo as Background, and I also want to add elements from above (lines, other panels, tex - this is not important), but when adding, a new object will replace the previous one, and not superimposed on it, tell me how to fix it

  • try OverlayLayout - Stranger in the Q
  • Show a piece of sample code - ezhov_da
  • @ezhov_da will probably not get along with a piece, there are several classes, in fact I would have had enough logic, or the simplest example, where there are two panels, roughly a red square, and yellow on top which is two times smaller, and all of them are visible, but if so more convenient, here's a link to the project github.com/Zherikhov/TicTacToe - Vlad Zherihov
  • I looked at your project - a lot of wrong logic, for example from this code: mainPanelBottom.add (game, BorderLayout.SOUTH); mainPanelBottom.add (setting, BorderLayout.SOUTH); mainPanelTop.add (gameBackground, BorderLayout.CENTER); mainPanelTop.add (settingField, BorderLayout.CENTER); the last component will be installed - ezhov_da
  • Explain in your example what you are trying to achieve? - ezhov_da

1 answer 1

In general, it didn't work out right away, but this article turned out to be very useful for me - http://www.skipy.ru/technics/gui_int.html