"Is using the paintComponent() method the only way to draw to a JPanel?"
Technically, no. But it's the correct way.
"The way my old class works is it uses a constant while loop (managed for frame rate) to continuously call the update() and draw() methods that do all the work"
Don't do this. Instead implement a javax.swing.Timer
passing delay to timer, which will determine the frame rate. See more at How to Use Swing Timers
"With my updates converting draw() to paintComponent() the frame is drawn only once, and then disappears."
What you want to do is have a model class, say Asteroid
which maintains the state of each Asteroid
object. You can then maintain a List<Asteroid>
that you can iterate through in the Timer
calling each of its method to manipulate its state, then repaint() the panel with every tick of the timer. Then you can can iterate through the List in the paintComponent
method, and call each Asteroid
's draw
method.
"I need to find a way to keep redrawing the JPanel continuously. (to eliminate flicker I draw the panel by writing to an image and then drawing the image)"
It most cases, using the Timer
(if used correctly) will help in alleviating the flickering (of course given other factor that I may be unaware of).
"Is there a better way to do all of this?"
Take all the above notes into consideration and have a look at this answer, which takes all those points into consideration, and is also a wannabe asteroid like game/background of a game.
"Also, when I create a JButton in the JFrame class and try to draw it using the following code, nothing happens. What am I doing wrong?"
Can't tell with the bit of code you've provided.