Java Drawline, DrawOval, FillOval Kullanımı
import java.awt.*;
import java.applet.Applet;
public class NewJApplet extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.RED);
g.setFont(new Font("Verdana",Font.BOLD,12));
g.drawOval(18,12,20,20);
g.drawOval(48,12,20,20);
g.setColor(Color.blue);
g.drawLine(20,1,20,6);
g.drawLine(25,1,25,7);
g.drawLine(30,1,30,7);
g.drawLine(35,1,35,8);
g.drawLine(40,1,40,8);
g.drawLine(45,1,45,9);
g.drawLine(50,1,50,8);
g.drawLine(55,1,55,8);
g.drawLine(60,1,60,7);
g.drawLine(65,1,65,7);
g.drawLine(70,1,70,6);
g.fillOval(25,18,9,9);
g.fillOval(55,18,9,9);
g.setColor(Color.BLACK);
g.drawOval(42,30,0,30);
g.setColor(Color.BLACK);
g.drawOval(25,66,40,0);
g.setColor(Color.BLUE);
g.fillOval(35,80,15,80);
g.setColor(Color.RED);
g.fillRoundRect(1,80,20,100,10,10);
g.drawRoundRect(20,80,50,125,10,10);
g.fillRoundRect(70,80,20,100,10,10);
g.fillRoundRect(25,205,18,100,10,10);
g.fillRoundRect(45,205,18,100,10,10);
}
}
import java.applet.Applet;
public class NewJApplet extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.RED);
g.setFont(new Font("Verdana",Font.BOLD,12));
g.drawOval(18,12,20,20);
g.drawOval(48,12,20,20);
g.setColor(Color.blue);
g.drawLine(20,1,20,6);
g.drawLine(25,1,25,7);
g.drawLine(30,1,30,7);
g.drawLine(35,1,35,8);
g.drawLine(40,1,40,8);
g.drawLine(45,1,45,9);
g.drawLine(50,1,50,8);
g.drawLine(55,1,55,8);
g.drawLine(60,1,60,7);
g.drawLine(65,1,65,7);
g.drawLine(70,1,70,6);
g.fillOval(25,18,9,9);
g.fillOval(55,18,9,9);
g.setColor(Color.BLACK);
g.drawOval(42,30,0,30);
g.setColor(Color.BLACK);
g.drawOval(25,66,40,0);
g.setColor(Color.BLUE);
g.fillOval(35,80,15,80);
g.setColor(Color.RED);
g.fillRoundRect(1,80,20,100,10,10);
g.drawRoundRect(20,80,50,125,10,10);
g.fillRoundRect(70,80,20,100,10,10);
g.fillRoundRect(25,205,18,100,10,10);
g.fillRoundRect(45,205,18,100,10,10);
}
}
Kodun Cıktısı ;
Yorumunuzu Ekleyin