I am new to Java game programming, but the more I read the more I'm confused, because there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.
There are alsoI've seen several different approaches to make a game loop:
- The standard approach, that uses the Timer class (seems to be less precise).
- The more precise approach that uses System.nanoTime.
- A simple approach that uses scheduleAtFixedRate.
Which one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.