11. Closure Conversion
Java
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
System.out.println("You clicked the button");
}
});
Wednesday, June 8, 2011
12. Closure Conversion
Java
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
System.out.println("You clicked the button");
}
});
jRuby
Wednesday, June 8, 2011
13. Closure Conversion
Java
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
System.out.println("You clicked the button");
}
});
jRuby
button.add_action_listener do |e|
puts "You clicked the button"
end
Wednesday, June 8, 2011