Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rectangle from image  RSS feed

 
ilan orlov
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to write an application that will load an image into JPanel and the user will able to select a rectangle from the image. I mean that the user will be able to click on the image and drag the mouse until he gets his preferred rectangle from the shown image. During this process a red border will be shown and updated for the selected area.
After it, I will have the rectangle coordinates.

How can I do it?

Thank you all,
Ilan
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ilan

I believe you can find all you need in these Sun Java� tutorials:
Performing Custom Painting
How to Write a Mouse Listener
How to Write a Mouse-Motion Listener
 
ilan orlov
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,

but do you have more specific examples?
 
Campbell Ritchie
Sheriff
Posts: 53734
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ilan orlov:
Thank you,

but do you have more specific examples?
Show Some Effort
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!