• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

rectangle from image

 
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
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • 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?
 
Marshal
Posts: 64714
226
  • 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!