Drawing on an image using Swing
In one of the screens in my application, a fe开发者_StackOverfloww 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
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/
精彩评论