Switch to lambda

This commit is contained in:
gaugendre 2015-06-04 23:40:48 +02:00
parent 249e6994db
commit 38f0ee78b2

View file

@ -44,14 +44,11 @@ public class MainPanel {
} }
} }
}); });
copyToClipboardButton.addActionListener(new ActionListener() { copyToClipboardButton.addActionListener(e -> {
@Override String myString = outputField.getText();
public void actionPerformed(ActionEvent e) { StringSelection stringSelection = new StringSelection(myString);
String myString = outputField.getText(); Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection stringSelection = new StringSelection(myString); clpbrd.setContents(stringSelection, null);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
}
}); });
} }