Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class Main extends JPanel {

    public static void main(String[] a) {
        JFrame f = new JFrame();
        f.setSize(400, 400);
        f.add(new Main());
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
    }

    public void paint(Graphics g) {
        g.setColor(Color.yellow);
        g.fillArc(5, 15, 50, 75, 25, 165);
    }
}