>:Is there any easy way to make a JTextField semi-transparent (maybe 50%
>:alpha)?
[quoted text clipped - 7 lines]
>:
>:-Ally
That's method, not function -- let's be OO purists. :-)
Actually, you should not generally override paint() in a Swing
component. You might be interested in a good page on the topic at
<http://java.sun.com/products/jfc/tsc/articles/painting/index.html>. In
fact, it might even offer clues to the actual source of your trouble.
Without detailed code samples and other things, I can't do much more
than speculate, but it may be that opacity is involved in this as well.
Once you read that article, you'll understand what paint() actually does
in Swing -- which is to paint the component itself, then its border,
then its children. Swing components, as subclasses of JComponent, all
have the setOpaque(boolean) method. This lets you create a contract
between the RepaintManager and your Swing component indicating whether
or not you'll draw the entire background when painted. Judicious use of
this call, and a good understanding of what happens when it's true or
false, could help to get you where you want to be.
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama
Andrey Kuznetsov - 22 Jan 2005 02:25 GMT
>>:I tried setting the background color to "new Color(255,255,255,70)", but
>>:the JTextField's background pickedup all sorts of weird things, and
[quoted text clipped - 23 lines]
> this call, and a good understanding of what happens when it's true or
> false, could help to get you where you want to be.
You should also be aware, that caret of JTextField is repainted
with paintImmediately(x, y, w, h) what could lead you
to additional problems.

Signature
Andrey Kuznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities