sendButton.onClick += clickHandlerFn
Because: 1. It's really rather nice to have first-class functions and lambdas/closures available, not just methods tethered to a particular class 2. There could be multiple handlers for the onClick event, '=' implies there's only ever one, '+=' doesn't For what it's worth, ScalaFx property binding (closely related to events) uses a different notation: scrollBar.value ==> progressBar.value On 2 May 2012 15:59, Joseph Ottinger <[email protected]> wrote: > ricky: the java version is way worse, because it doesn't use =. > > > On Wed, May 2, 2012 at 10:53 AM, Ricky Clarkson > <[email protected]>wrote: > >> sendButton.addMouseListener(clickListener); >> On May 2, 2012 11:51 AM, "phil swenson" <[email protected]> wrote: >> >>> >> I'd like to know what does he mean with "no events". >>> >>> in Delphi you could do stuff like: >>> >>> sendButton.onClick = ClickHandlerMethod >>> >>> >>> >>> I don't even want to think about what the equivalent is in Java. >>> >>> Basically, you need function pointers. >>> >>> >>> >>> On Wed, May 2, 2012 at 2:30 AM, Fabrizio Giudici >>> <[email protected]> wrote: >>> > On Tue, 01 May 2012 19:41:57 +0200, Casper Bang <[email protected] >>> > >>> > wrote: >>> > >>> >> On Tuesday, May 1, 2012 6:46:05 PM UTC+2, phil swenson wrote: >>> >>> >>> >>> >>> >>> I remember being very disappointed when I first looked at Java for >>> >>> writing desktop UIs. It was a huge step backwards from all the >>> >>> lessons learned from Delphi and VB in the 90s. No properties, no >>> >>> events, layout hell, overly complicated APIs. >>> >>> >>> >> >>> >> And yet, the hardcore Java developer will defend it vigorously. >>> > >>> > >>> > This is not true as most Java developers know that Swing is pretty >>> old. BTW, >>> > getting back to the original Phil's statement, apart from the fact >>> that you >>> > can have properties in the language with an annotation processor, I'd >>> like >>> > to know what does he mean with "no events". One of the problems of >>> Swing is >>> > perhaps that there are too many (kinds of) events. >>> > >>> > >>> > -- >>> > Fabrizio Giudici - Java Architect, Project Manager >>> > Tidalwave s.a.s. - "We make Java work. Everywhere." >>> > [email protected] >>> > http://tidalwave.it - http://fabriziogiudici.it >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "The Java Posse" group. >>> > To post to this group, send email to [email protected]. >>> > To unsubscribe from this group, send email to >>> > [email protected]. >>> > For more options, visit this group at >>> > http://groups.google.com/group/javaposse?hl=en. >>> > >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "The Java Posse" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/javaposse?hl=en. >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "The Java Posse" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/javaposse?hl=en. >> > > > > -- > Joseph B. Ottinger > http://enigmastation.com > Ça en vaut la peine. > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > -- Kevin Wright mail: [email protected] gtalk / msn : [email protected] quora: http://www.quora.com/Kevin-Wright google+: http://gplus.to/thecoda <[email protected]> twitter: @thecoda vibe / skype: kev.lee.wright steam: kev_lee_wright "My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
