![]() 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) Runnable r = new Runnable() void run(), change this to whatever you want Try this for line 3: GreenfootImage image new GreenfootImage (text, 24, Color.BLACK, new Color (500,100,0)) If you still do not see it, make. 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.* Two things: (1) you have text being brought into the method, yet, you use literal text for the image and (2) if you want the background color to show, it cannot have a zero alpha (transparency) value. 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. 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(). 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. ![]() ![]() Greenfoot Java - a visual 3D educational software tool with a code editor to create. The following screenshot shows a test of TextBubbleBorder 1. Cartoon style color ball acquired through Microsoft Office 2000.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |