java - JButton with background image and backlighting -


i'm writing checkers. so, every cell jbutton, has image (imageicon).

i want jbutton has background image , backlighting (for example, blue of red), because want show user available turns. possible?

now if create new jbutton(icon icon) , setbackground(color.blue); background ignored.

you should set border color blue or red (i believe looking answer)

try statement:

chessbutton.setborder(borderfactory.createlineborder(color.green)); 

painting jbutton's border not effected image icon, therefore if want create highlight effect , set border's color should use borderfactory. can have various effects border through borderfactory

if want complete background highlighted or special effect have 2 separate image of each cell i.e. 1 normal image , 1 highlighted image. when want show user available turns, update respective cells corresponding highlighted image


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -