Results 1 to 11 of 11
- 03-10-2012, 02:48 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
How to detect object by going near to it
I am new to java i have plot of line if i go near to the line it should be highlighted for example in the below link
How This Bear Market Compares - Interactive Graphic - NYTimes.com
In this link when you go closer to the line it will be highlighted how to implement it.
-
Re: How to detect object by going near to it
If you want something like that (in the link you provided), especially for a website, it would probably be better and a lot easier to do it in SVG & HTML5.
If you still want to do this in Java you will need to look at a few things,
Mouse Motion Listener: (to detect onmouseover events)
How to Write a Mouse-Motion Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)
Drawing lines with Java 2D:
Drawing Geometric Primitives (The Java™ Tutorials > 2D Graphics > Working with Geometry)
- 03-13-2012, 08:28 PM #3
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
Re: How to detect object by going near to it
Last edited by Sudharshan; 03-13-2012 at 08:34 PM.
- 03-13-2012, 08:45 PM #4
Re: How to detect object by going near to it
If you know where the mouse is and where the line is, you should be able to compute the distance between them.i want to detect line when my mouse cursor is 5 or 10 pixel away from line
- 03-13-2012, 08:52 PM #5
- 03-13-2012, 08:53 PM #6
Re: How to detect object by going near to it
How do you know of all these methods?
- 03-13-2012, 09:08 PM #7
Re: How to detect object by going near to it
By hanging around forums for years ;)
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 03-13-2012, 09:11 PM #8
Re: How to detect object by going near to it
And having a brain like flypaper.
- 03-13-2012, 10:40 PM #9
Re: How to detect object by going near to it
Like used flypaper :)
Why do they call it rush hour when nothing moves? - Robin Williams
- 03-13-2012, 10:44 PM #10
Re: How to detect object by going near to it
More seriously, since I'm not a programmer, I'm free to learn and remember whichever aspects of Java take my interest. So while I've picked up quite a bit about Swing and Java2D, I know next to nothing about networking, and have to look at I/O API 20 times to write a few lines of code to read a text file.
You guys have to handle whatever the job throws at you, and if that doesn't happen to appeal to you it won't stick so well. Even so, your knowledge is several orders of magnitude greater than mine.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 03-14-2012, 01:17 AM #11
Similar Threads
-
JMF: Trying to detect webcam..help!
By boblettoj99 in forum AWT / SwingReplies: 0Last Post: 11-09-2011, 11:51 PM -
Detect system shutdown/log off
By cmpie1 in forum New To JavaReplies: 0Last Post: 11-29-2010, 05:07 AM -
How to detect deadlocks
By pinheiroa in forum Threads and SynchronizationReplies: 1Last Post: 09-03-2010, 01:36 PM -
Unable to detect OS name
By neetu.jainvi@gmail.com in forum Advanced JavaReplies: 1Last Post: 12-09-2009, 04:56 PM -
Detect the ENTER key being pressed
By aaronfsimons in forum New To JavaReplies: 12Last Post: 05-16-2009, 08:48 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks