0

I would like to know why when i write a text in a JtextArea with transparent background, the image from the frame starts to appear on the jtextarea background. on this link there is a print of my screen where the clouds are being copied from the frame.

http://postimg.org/image/rebtmcbwx/

My Code:

jTextArea1 = new javax.swing.JTextArea();
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jScrollPane1.setOpaque(false);
jTextArea1.setBackground(new java.awt.Color(255, 255, 255, 150));
  • Don't use alpha based colors for backgrounds of Swing components, Swing can't handle it, it deals with opaque or transparent components only – MadProgrammer May 10 '16 at 02:09
  • Remember, if you want your components to be see through, they need to start out as transparent through the entire container hierarchy for [example](http://stackoverflow.com/questions/16390918/java-is-there-a-way-to-insert-a-background-image-in-a-jlist/16390963#16390963) – MadProgrammer May 10 '16 at 02:16

0 Answers0