Java Drawrect, Fillrect , Clearrect , Draw3drect Ve Fill3drect

 

JAVA DRAWRECT

 

import javax.swing.JApplet;
import java.awt.*;
import javax.swing.*;

public class NewJApplet extends JApplet {


   public void paint(Graphics g) {
      super.paint(g);

      int size = 200;

      do {

         g.drawRect(150 - size/2, 150 - size/2, size, size);
         size = size - 20;

      } while (size > 0);

   }
}
 

 

Java drawRect, fillRect , clearRect , draw3DRect ve fill3DRect

 

  JAVA  FİLLRECT VE DRAWRECT

 


import java.applet.Applet;
import java.awt.*;
public class NewJApplet extends Applet {


 public void paint(Graphics g)

{
g.setColor(new Color(255,0,0));
g.drawRect(5,10,50,50);
g.fillRect(60,60,60,60);
 }
}
 

 

Java Drawrect, Fillrect , Clearrect , Draw3drect Ve Fill3drect

JAVA CLEARRECT

 

import javax.swing.JApplet;
import java.awt.*;
import java.applet.*;

public class NewJApplet extends JApplet {

public void paint(Graphics g){
int windowWidth = getWidth( );
int windowHeight = getHeight( );
g.setColor( Color.RED );
g.drawOval( 50, 50, 160, 150 );

g.clearRect( 85, 250, windowWidth, windowHeight );

g.drawOval( 150, 25, 170, 150 );

g.clearRect( 85, 250, windowWidth, windowHeight );

g.drawOval( 250, 25, 170, 150 );
}
}
 

 

Java Drawrect, Fillrect , Clearrect , Draw3drect Ve Fill3drect

JAVA DRAW3DRECT VE FİLL3DRECT

 


import javax.swing.JApplet;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class MainClass extends JPanel {

  public void paint(Graphics g) {
    g.setColor (Color.gray);
    g.draw3DRect (25, 10, 50, 75, true);
    g.draw3DRect (25, 110, 50, 75, false);
    g.fill3DRect (100, 10, 50, 75, true);
    g.fill3DRect (100, 110, 50, 75, false);
  }

  public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.getContentPane().add(new MainClass());

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(200, 200);
    frame.setVisible(true);

    }

}
 

 

Java Drawrect, Fillrect , Clearrect , Draw3drect Ve Fill3drect

 

JAVA FİLL3DRECT

 


public class NewJApplet extends Applet {


public void paint(Graphics g){


g.setColor(Color.green);


g.fill3DRect(10,150,50,100,true);


g.fill3DRect(100,200,50,50,true);

}

}
 

 


Java Drawrect, Fillrect , Clearrect , Draw3drect Ve Fill3drect

 

Merve Rogop

Yorumunuzu Ekleyin


Yükleniyor...
Yükleniyor...