- Aug 19, 2001
- 1,628
- 0
- 76
I'm writing a java program that analyzes images (circle detection). I expect that sometimes, artifacts in the source images will throw it off. So I have load the image as a BufferedImage and scale it down 50% (source images are 2000x1312). Now I'm at the part where I need to show the scaled BufferedImage in the JFrame, along with a few JLabels and buttons for controls.
So most of what I've found from google, etc, is that the easiest way to show the image is pane.add(New JLabel(New ImageIcon(myBufferedImage)));
But elsewhere, I've read that JLabels cannot use any kind of mouseinput!
I need to be able to click on the scaled image in order to run my analysis correction routine. I need to know the x,y coords of the mouse as the user moves around the image, as well as whether or not they are right or left clicking.
Can someone give me a few pointers with how to do this?
So most of what I've found from google, etc, is that the easiest way to show the image is pane.add(New JLabel(New ImageIcon(myBufferedImage)));
But elsewhere, I've read that JLabels cannot use any kind of mouseinput!
I need to be able to click on the scaled image in order to run my analysis correction routine. I need to know the x,y coords of the mouse as the user moves around the image, as well as whether or not they are right or left clicking.
Can someone give me a few pointers with how to do this?
