This Java Graphics tutorial will show you how to drawOval shape using Java Graphics. [ /** * * @author Eric * Blog:www.techoverload.ne...
This Java Graphics tutorial will show you how to drawOval shape using Java Graphics.
[
[
/** * * @author Eric * Blog:www.techoverload.net */
import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.Graphics; import java.awt.Font; import java.awt.Color; import java.awt.Dimension; public class JavaGraphics extends JPanel { public void paint(Graphics g) { g.setColor(Color.red); g.drawOval(10, 10, 200, 200); } public static void main(String args[]) { JFrame frame=new JFrame(" Graphics Example"); frame.setSize(new Dimension(300,300)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.getContentPane().add( new JavaGraphics()); frame.setVisible(true); } }]