Here is a sample tutorial making fun with JFrame, giving it all the shapes that you can to a frame. Make a frame look circular, ellipse, curve, rounded rectanble, some other different shape that cannot be defined and may not be seen. Here i will show how you can customize your JFrame as you wish.
Round Rectangle: Mostly found. A Rectangle with rounded corners. Double is a static class in the RoundRectangle2D class located in the java.awt.geom package.
QuadCurve.Double(double x1,double y1,double ctrlx,double ctrly,double x2,double y2): Another shape.
CubicCurve2D.Double(double x1,double y1, double ctrlx1,double ctrly1,double ctrlx2,double ctrly2,double x2,double y2): The cubic curve shape. Define it yourself seeing what shape you get :)
Arc2D.Double(Rectangle2D rd,double start,double end, int type): Rectangle2D is an abstract class therefore, we use Rectangle2D.Double class which is static inner class. In this we specify, the x,y coordinates and width and height. Next the type of the arc. Possible types are Arc2D.CHORD, Arc2D.PIE, Arc2D.OPEN.
Circular Shape |
Cubic Curve Shape |
QuadCurve.Double(double x1,double y1,double ctrlx,double ctrly,double x2,double y2): Another shape.
CubicCurve2D.Double(double x1,double y1, double ctrlx1,double ctrly1,double ctrlx2,double ctrly2,double x2,double y2): The cubic curve shape. Define it yourself seeing what shape you get :)
Arc2D.Double(Rectangle2D rd,double start,double end, int type): Rectangle2D is an abstract class therefore, we use Rectangle2D.Double class which is static inner class. In this we specify, the x,y coordinates and width and height. Next the type of the arc. Possible types are Arc2D.CHORD, Arc2D.PIE, Arc2D.OPEN.
No comments:
Post a Comment