jan said:
Well, if you're already woring with Rectangle2D objects, then you could pass
them to Graphics2D.draw() and the Graphics2D object will render your
rectangle. You could obtain 3D-like borders by drawing two rectangles
slightly offset from each other, and using two colours (light and dark) for
each rendered rect. That would give you essentially an raised or etched
border effect, which is what you're after, ... ?
What I actually want to accomplish is this:
I implementing a backgammon board game. The board is a JPanel that has a
very long paintComponent() method where all the drawing is done (lots of
shapes, rectangles and polygons...). I want to give certain rectangles a
raised 3D border, so I used fill3DRect(). However, this method uses the
current color exclusively and ignores the current paint which is not so
good since I want to fill the rectangle with a texturepaint. So this
won't work:
....
TexturePaint tp = new TexturePaint(bImage, tr);
g2D.setPaint(tp);
g2D.fill3DRect(...);
....
So now I'm looking for a way to draw a rectangle in my paintComponent()
method that has a 3D raised border and that can contain a texturepaint.
I'm kind of stuck on this for a couple of weeks now :-(