manuipulating JPEGs in an GUI


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: manuipulating JPEGs in an GUI

  1. #1
    Join Date
    Nov 2004
    Posts
    9

    manuipulating JPEGs in an GUI

    Hi, I'm creating a GUI in which users are required to interact with graphs. I have a jFrame on which I have put a jLabel and used this label to import a JPEG of a graph (i.e it's an icon). My problem is that the user needs to pick a point on the graph, and from that two coordinates will be obtained. These coordinates obviously need to corespond with the axes on the graph. How can I convert the pixel coordinates of the jLabel that the mouseClicked event will give me into coordinates that correspond to the JPEG graph? Any help is great appreciated!

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Implement the mousemoverlistener interface for the container that contains the component that you want to track the mouse position from. The mouse event has a method, getPoint(), you shold use that.
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center