I'm trying to display an oval but the oval doesn't show.
This is my code:
package guitut; import javax.swing.*; import java.awt.*; public class GUItut { static int x = 50; static int y = 50; private static class BallAnimate extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); g.drawOval(x, y, 50, 100); } } public static void main(String[] args) { BallAnimate displayPanel = new BallAnimate(); JPanel content = new JPanel(); content.add(displayPanel); JFrame window = new JFrame(); window.setContentPane(content); window.setSize(400,400); window.setVisible(true); } }