help making class print in jpanel
So i have this code called jpanel and I want to use it as a gathering place for all my other classes to work together in, in the game I'm making
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AJPanel extends JPanel {
public A3JPanel() {
setBackground(Color.white);
}
public void paintComponent(Graphics g){
super.paintComponent(g);
}
}
now its pretty bare right now because I deleted all the stuff in it as it didn't work and got messy, basically the first thing I want to do right now is make my background in a class called something like "Background" then get it to be printed out in the paint component. ( don't worry about the jframe, that's already been set and is working fine along with the application file.) So how would I go about doing that?