by Dinesh Thakur Category: Swing

 

import javax.swing.*;

import java.awt.*;
public class J3DRectanglesJavaExample extends JFrame
  {
       public void paint(Graphics gp)
         {
               super.paint(gp);
               final int WIDTH = 70, HEIGHT = 90;
               gp.setColor(Color.RED);
               gp.fill3DRect(30, 50,60,70, true);
               gp.fill3DRect(100, 50,60, 70, false);
         }
                public static void main(String[] as)
                   {
                          J3DRectanglesJavaExample frm = new J3DRectanglesJavaExample();
                          frm.setSize(190, 170);
                          frm.setVisible(true);
                   }
  }
3D Rectangles in Java Swing Example



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles