I have not been programming for too long to know or understand how different java classes is doing when it comes to performance…
This might be a normal question, I did search the forum but didnt find an answear to it.
Which is best to use: JFrame or Canvas?
What are the Pros and Cons with each?
And also something that came to mind right now while typing:
Updating graphics on for example JPanel… Then you call the paintComponent method… But that method takes a Graphics g in its parameters… What is the correct way of calling it from for example a game loop? Should i just create an empty Graphics object on the game initialization and use that or should i actualy declare the object to something?