What is the purpose of using `paintComponent()` in Java?
The `paintComponent()` method is used to perform custom rendering, like drawing images or shapes on a `JPanel`.
Exactly! `paintComponent()` allows you to customize how a component is rendered, including drawing images.
Can you explain how the `Graphics` object is used within `paintComponent()` to draw images?