![]() ![]() Graphics.drawRoundRect(0, 0, width-1, height-1, arcs.width, arcs. Graphics.fillRoundRect(0, 0, width-1, height-1, arcs.width, arcs.height) //paint background tRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON) ![]() drawPolygon (int, int, int) - Method in class greenfoot. Draw an oval bounded by the specified rectangle with the current drawing color. drawOval (int, int, int, int) - Method in class greenfoot. Runnable r = new Runnable() void run(), change this to whatever you want Draw a line, using the current drawing color, between the points (x1, y1) and (x2, y2). Ultimately I would like this to work for a non-standard color in the parent container, but it was partly inspired by What do I need to do to replicate this component with gradient paint?ĭoes anybody know a way to get those corners transparent? import java.awt.* The corners default to the default panel color (easiest to see in Panel 2). However you can see the downside of this approach when there is a red BG (or any non-standard color) on the parent panel. We know images as pictures or drawings, but they can be much more. I found a way to restrict the BG color of a label to 'inside the border' by setting a Clip (representing the area outside the rounded corners) on the Graphics2D instance and calling clearRect(). The GreenfootImage class, as the name implies, allows us to manipulate images in Greenfoot. I would like to make the corners of the component that are outside the rectangle to be entirely transparent & show whatever component is beneath it. ![]() The following screenshot shows a test of TextBubbleBorder 1. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |