I have been looking all over the Internet for this.
Can someone please provide or point to some sample
source code implementing the classical rubberband
rectangular selection??
In fact, since this seems so hard to find, I am
willing to compromise. I only need to capture the
two endpoints: where the user originally clicked
and where the mouse was released. That's all I need
for my prototype, and I can worry about the visual
feedback (the actual XOR rubberband) later.
I very, very much appreciate any help.
-Ramon F Herrera
Robert Metzger - 21 Dec 2004 15:47 GMT
>I have been looking all over the Internet for this.
>
[quoted text clipped - 9 lines]
>feedback (the actual XOR rubberband) later.
>I very, very much appreciate any help.
how about a MouseInputListener which makes appropriate
use of mousePressed(), mouseReleased(), and mouseClicked()
and getPoint()?

Signature
Robert Metzger
Hewlett-Packard Company
High Performance Computing Division
Ramon - 21 Dec 2004 21:20 GMT
Thanks a lot, Robert. That's exactly what I needed.
There is one issue with all those Java classes, interfaces,
packages, etc. in which the problem is NOT finding a needle in the
proverbial haystack, but determining whether you are looking in the
right haystack at all. :-)
-Ramon
Andrei Kouznetsov - 21 Dec 2004 23:30 GMT
> Can someone please provide or point to some sample
> source code implementing the classical rubberband
> rectangular selection??
see http://jgui.imagero.com/examples/ImagePanel/

Signature
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
Remi Bastide - 28 Dec 2004 10:39 GMT
>I have been looking all over the Internet for this.
>
>Can someone please provide or point to some sample
>source code implementing the classical rubberband
>rectangular selection??
see:
http://liihs.univ-tlse1.fr/~bastide/Teaching/java/PolyLine/Default.html
and:
http://liihs.univ-tlse1.fr/~bastide/Teaching/java/PolyLine/solutions.html
two different solutions, meant to exemplify the "state" design
pattern.
>In fact, since this seems so hard to find, I am
>willing to compromise. I only need to capture the
[quoted text clipped - 5 lines]
>
>-Ramon F Herrera