Java: Transparent TextArea + draw background

10,050

1) Override the paintComponent() method of the JTextArea something like:

g.drawImage(...);
super.paintComponent(g);

2) When you create the text area you will need to give it a transparent background:

setBackground( new Color(r, g, b, alpha) );
Share:
10,050
Blackvein
Author by

Blackvein

Updated on June 04, 2022

Comments

  • Blackvein
    Blackvein almost 2 years

    My question here is fairly simple. Can JTextArea's be set to transparent, but not completely invisible? Also, if it's possible, how can I draw an image behind it (draw the image first, and then draw the transparent text area overtop of it)?