0

I'm new to Java and I have seen that some games use Canvas and some use JPanel as the class that Game class inherits from. Here is a sample project but it's a bit old. I am not sure what should I use today. Isn't Canvas outdated?

Philipp
  • 119,250
  • 27
  • 256
  • 336
  • 2
  • @ZielonyXD Are you sure? It looks like the exact same question to me. What would you like to know that isn't already explained in the linked question? – Philipp May 01 '23 at 09:45
  • @Philipp would like to know if Canvas are still being used. I have seen that some Canvas-based games have also a class that inherits from java.applet.Applet which is surely insecure and out of date. Under the link that you posted here I can see that Canvas may be attached to other components like JPanel. So what is the purpose of using JPanel itself as the main game class parent, since it isn't as portable as Canvas? – Zielony XD May 01 '23 at 15:03
  • the purpose of using a JPanel in the main class is that you would add more componente, like JButtons, JTrees or other stuff from swing - honestly your question is very vague. "i have seen same Canvas-based games" you could provide these examples to get a better answer – Martin Frank Oct 02 '23 at 07:52

0 Answers0