java - Translucent JLabel not properly showing background -


i have following line:

        label.setbackground(new java.awt.color(0, 150, 0, 50)); 

i place in mousereleased method within mouseadapter.

basically, want make label highlight in translucent green when click on it.

i have several labels in panel, mouseadapter added them.

my problem this:

-when click on label, shows translucent green color, showing background of jlabel, not 1 click on.

no matter label click on, paints background of same label.

-whenever click on label, repeats same background. -weirdly, every time click on jlabel, opacity of green color seems increase, if painting translucent green on each time click on new jlabel.

any tips on what's going on? should try post sscce on this? or there simple answer i'm missing. reason didn't post sscce yet code large , spread across multiple files, must trim out first.

see backgrounds transparency probable problem , couple of solutions.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -