Skip to content

Commit

Permalink
Adds a new mouse click event handler to the node without removing any…
Browse files Browse the repository at this point in the history
… existing handlers
  • Loading branch information
besidev committed Nov 12, 2024
1 parent fed7438 commit c7565cc
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.Node;
import javafx.scene.input.MouseEvent;

import java.io.File;
import java.util.concurrent.CompletableFuture;
Expand All @@ -16,12 +17,9 @@
*/
abstract class BaseFileSavePicker extends BaseFilePicker implements FileSavePicker {

/**
* {@inheritDoc}
*/
BaseFileSavePicker(Node node) {
super(node);
node.setOnMouseClicked(mouseEvent -> showDialog());
node.addEventHandler(MouseEvent.MOUSE_CLICKED, mouseEvent -> showDialog());
}

abstract void showDialog();
Expand Down

0 comments on commit c7565cc

Please sign in to comment.