I have a JLabel
with text. The text displays in different colors and since I also want the background to change color, I found sometimes the text it's hard to read. That is why I want to add a shadow to the font like this: React Native font outline / textShadow
Can someone tell me how to get this effect in a Java Swing label or, if not possible, which Swing component I should use instead?
You can convert the text to an outline and stroke it.
You'll want to avoid the executing heavyweight bits like instantiating the Font, converting the text to an outline, etc every draw.