๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
4 messages
4 total messages Started by Pax Fri, 30 Sep 2005 07:56
Is there Doubleclick event or listener?
#370
Author: Pax
Date: Fri, 30 Sep 2005 07:56
6 lines
1109 bytes
I have tried to find an implementation for detecting a doubleclick in 
JBuilder2005 without succes.

Is there none?

Peder Sk๏ฟฝnning
Re: Is there Doubleclick event or listener?
#371
Author: Paul Furbacher [TeamB]
Date: Fri, 30 Sep 2005 13:50
35 lines
2154 bytes
Pax wrote:

> I have tried to find an implementation for detecting a doubleclick in 
> JBuilder2005 without succes.

Double-clicking is a condition that you can test for
when handling a mouse event.  So yes, JBuilder assists
you in writing the stub of the mouse handling code, but
it's up to you to test for a double-click by writing
code inside the mouse event handler which JBuilder
creates for you in the Designer.

Google:

   +mouse +"double-click" +java

Here's one of the better hits:

http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html


-- 


Paul Furbacher (TeamB)

   Save time, search the archives:
        http://info.borland.com/newsgroups/ngsearch.html

   Is it in Joi Ellis's Faq-O-Matic?
        http://www.visi.com/~gyles19/fom-serve/cache/1.html

   Finally, please send responses to the newsgroup only.
   That means, do not send email directly to me.
   Thank you.
Re: Is there Doubleclick event or listener?
#375
Author: Pax
Date: Tue, 04 Oct 2005 09:18
34 lines
2215 bytes
>> I have tried to find an implementation for detecting a doubleclick in 
>> JBuilder2005 without succes.
>
> Double-clicking is a condition that you can test for
> when handling a mouse event.  So yes, JBuilder assists
> you in writing the stub of the mouse handling code, but
> it's up to you to test for a double-click by writing
> code inside the mouse event handler which JBuilder
> creates for you in the Designer.
>
> Google:
>
>   +mouse +"double-click" +java
>
> Here's one of the better hits:
>
> http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html
>
Thank You Paul!

I got that to work all right, but...

When I implement it on a tableframe, the second click drowns, because 
cliking a tableframe has a build in handler that changes the clicked cell to 
edit mode. Why is the event drowned in Java and not sent on to the next 
level in the hieracy?

In Delphi events boubles up and can be catched on any level, but in Java 
they seem to die once they are catched.

Do I need to study event handling in Java harder, or is there a trick to 
send the event on?

Peder 
Re: Is there Doubleclick event or listener?
#376
Author: Paul Nichols (TeamB)
Date: Fri, 07 Oct 2005 04:40
54 lines
2948 bytes
"Pax" <2mailmeusepax@paxitdotdk> wrote in message
news:4342487b$1@newsgroups.borland.com...
> >> I have tried to find an implementation for detecting a doubleclick in
> >> JBuilder2005 without succes.
> >
> > Double-clicking is a condition that you can test for
> > when handling a mouse event.  So yes, JBuilder assists
> > you in writing the stub of the mouse handling code, but
> > it's up to you to test for a double-click by writing
> > code inside the mouse event handler which JBuilder
> > creates for you in the Designer.
> >
> > Google:
> >
> >   +mouse +"double-click" +java
> >
> > Here's one of the better hits:
> >
> >
http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html
> >
> Thank You Paul!
>
> I got that to work all right, but...
>
> When I implement it on a tableframe, the second click drowns, because
> cliking a tableframe has a build in handler that changes the clicked cell
to
> edit mode. Why is the event drowned in Java and not sent on to the next
> level in the hieracy?
>
> In Delphi events boubles up and can be catched on any level, but in Java
> they seem to die once they are catched.
>
> Do I need to study event handling in Java harder, or is there a trick to
> send the event on?
>
> Peder
>
ActionEvents and ListenerEvents are much different than in their Delphi
Counterparts, just as EventHandlers are different between Unix and Windows.

You need to study these models to learn the differences. Keep in mind that
Java levels of asbtraction are much higher than those in Delphi, especially
true on ListenerEvents.

If the TableModel you are using has a DefaultHandler (which it does in a
DefaultTableModel), you will need to override the functionality in the
DefaultTableModel, or choose another TableModel and implement your new
events in that Model. Sun has very good tutorials on their sight about
Events and Listeners and TableModels.

Good luck!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads