SwingJD πίνακες μέρος 2

Posted by Unknown Sunday, December 9, 2012 0 comments

20121130Friday, November 30, 2012

SwingJD tables part 2

StandardCurvedPanel is a custom swing JPanel. This extends the JPanel and replaces the method paintComponent (). StandardCurvedPanel looks like this

RoundedRectangle background + figure + OuterRectangle = StandardCurvedPanel.
Now allows us to discuss how each is created from it.


//Create the roundRect table
Shape shape = new RoundRectangle2D. Double (0, 0, width, height, 26, 26);
//Create color variation
Painting new GradientPaint GradientPaint = (0, 0, bgColor (color), 0, 2 *
getHeight (), WHITE Color);
//Add the color table roundRect
g2d. setPaint (Paint);
//Fill the shape
g2d.Fill (SHAPE);

>

Figure//Curved
Shape = shape createShape (width);
Painting new GradientPaint GradientPaint = (0, 2, new color (255, 255, 255, 200), 0, 50, fgColor. getColor2 ()),
g2d. setPaint (Paint);
g2d.Fill (SHAPE);

private {shape createShape (int width)
Shape shape = new GeneralPath ()?
.MoveTo (figure (GeneralPath)) (15.1308, 1.8172914);
.CurveTo (figure (GeneralPath)) (6.820799, 1.8172914, 2.1307993, 4.507291, 2.1307993, 13.817291);
.LineTo function (figure (GeneralPath)) (2.1307993, 31.78604);
.CurveTo (figure (GeneralPath)) (39.09004, 37.30802, 86.78241, 40.69229, width/2, 40.69229);
.CurveTo (figure (GeneralPath)) (width/2, 40.69229, width/2 + 30, 38.130333, width-1, 33.84854);
.LineTo function (figure (GeneralPath)) (width-1, 11.817291);
.CurveTo (figure (GeneralPath)) (width-1, 6.507291., width-5, 2.8172914, width-13, 1.8172914);
.LineTo function (figure (GeneralPath)) (18.1308, 1.8172914);
(Shape) closePath (GeneralPath);
return shape?
} //External contour
g2d. setStroke (new BasicStroke (3))?
shape = new RoundRectangle2D. Double (1, 1,-3, width height-3, 11.2, 11.2);
g2d. setPaint (new color (255, 255, 255,100));
g2d.Draw (SHAPE);

For more information and source code click on the following location
SwingJD works Panels Part2
Posted by Jeeru (Nov 30, 2011, 12: 01: 16 PM EST) Permalink


View the original article here

THANK YOU FOR YOUR VISIT
Title: SwingJD πίνακες μέρος 2
Posted By Unknown
Blog Rating 5 dari 5
Hopefully this article useful to you. If you wish to quote, either part or all of the contents of this article please include a "dofollow links" to http://izone2.blogspot.com/2012/12/swingjd-2.html. Thank you for reading our articles and continue to follow this blog article.

0 comments:

Post a Comment

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of Info Zone.