paintComponent not working
问题 this may be a silly question but How do i call the paintComponent? Its not displaying the object at all. its within the, public class Ball extends JPanel implements Runnable. public class Balls { public static void main(String[] args) { new Balls(); } public Balls() { EventQueue.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame("Balls!"); frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE); frame.add(new ballAdder()); frame.setSize(1000, 1000); frame.setVisible(true);