Drawing on an image using Swing
-
08-10-2019 - |
Question
In one of the screens in my application, a few images are shown. All I want to do is to frame with a black line the image that the user has clicked on. Basically, I want to emphasize the chosen image. The black frame is just one of many ideas. You are welcome to suggest more efficient ideas.
I'm using NetBeans if it matters.
Thanks, Tomer
Solution
the best way to do this (if i get you right) is to subclass JComponent and overwrite the paint method.
take a look on the Reflection example on this site.
good sources for swing:
http://tips4java.wordpress.com/category/package/swing/
http://javagraphics.blogspot.com/
http://zetcode.com/tutorials/java2dtutorial/java2dimages/
and the best:
http://filthyrichclients.org/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow