Inner classes (like Button.ClickEvent) need a reference to an instance of the outer class (Button).
That syntax creates a new instance of Button.ClickEvent with its outer class reference set to the value of button.
Here’s an example – ignore the lack of encapsulation etc, it’s just for the purposes of demonstration:
class Outer
{
String name;
class Inner
{
void sayHi()
{
System.out.println("Outer name = " + name);
}
}
}
public class Test
{
public static void main(String[] args)
{
Outer outer = new Outer();
outer.name = "Fred";
Outer.Inner inner = outer.new Inner();
inner.sayHi();
}
}
See section 8.1.3 of the spec for more about inner classes and enclosing instances.