Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Inserter.java
- @FunctionalInterface
- public interface Inserter extends EventHandler<ActionEvent> {
- public abstract void handle(ActionEvent e);
- default void insert(parameters...) {
- ...inserting stuff to db
- }
- }
- // Other.java: insert stuff to db on button click
- // This works normally
- button.setOnAction(new Inserter() {
- @Override
- public void handle(ActionEvent e) {
- insert(parameters...);
- }
- }
- );
- // Possible to implement it this way? Cannot find symbol "insert"
- button.setOnAction(
- (e) -> insert(parameters...)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement