Simple Java question
Posted
by user322102
on Stack Overflow
See other posts from Stack Overflow
or by user322102
Published on 2010-04-21T09:08:36Z
Indexed on
2010/04/21
9:13 UTC
Read the original article
Hit count: 278
java
Hi All
I new to java so bare with me if this is a ridiculously simple question but I am curious about this method call which has {code} being taken in - see code below for an example in the method addSelectionListener. What is the purpose of this? I have been looking through docs for an explaination but cant seem to find what this practice is called never mind any useful information.
setStatusLine.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String message = "I would like to say hello to you.";
if (pressed) {
message = "Thank you for using me";
}
setStatusLine(message);
pressed = !pressed;
}
});
Thanks for any help or insights that can be offered
© Stack Overflow or respective owner