Draw 3D Rectangle and Square - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

Draw 3D Rectangle and Square

Demo Code



import java.awt.Color;
import java.awt.Graphics;
 
public class Main {
 
        public void paint(Graphics g){
               /*  w  ww .  ja va2s .  co m*/
                g.setColor(Color.green);
                g.draw3DRect(10,10,50,100,true);
                g.draw3DRect(100,100,50,50,true);
                g.setColor(Color.orange);
                g.fill3DRect(10,150,50,100,true);
                g.fill3DRect(100,200,50,50,true);
       
        }
}

Related Tutorials