How to listen to mouse entered over a node while its clicked in javaFX
<p>in javaFX i have a Pane and inside this pane another smaller pane with mouse listener. i want to detect mouse entered even if mouse is pressed. How?? ... the smaller pane does detect mouse entered but not if mouse was pressed elsewhere on the parent pane and then entered the smaller pane. </p>

<p>here i've written the problem in code, though i have problem in my project, the problem is the same, so i can use the solusion. but this is the problem! </p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

public class MouseTest extends Application {
 public void start(Stage primarysStage) throws Exception {
  primarysStage.setTitle("Problem");
  Pane wrapper = new FlowPane();
  wrapper.setPrefSize(400, 400);
  wrapper.setStyle("-fx-background-color: #FFFFFF");
  Scene scene = new Scene(wrapper, 400, 400);
  primarysStage.setScene(scene);
  Pane innerPane = new Pane();
  innerPane.setPrefSize(200, 200);
  innerPane.setStyle("-fx-background-color: green");
  EventHandler&lt;MouseEvent&gt; mouseEntered = new EventHandler&lt;MouseEvent&gt;() {
   @Override
   public void handle(MouseEvent e) {
    innerPane.setStyle("-fx-background-color: black");
   }
  };
  EventHandler&lt;MouseEvent&gt; mouseExited = new EventHandler&lt;MouseEvent&gt;() {
   @Override
   public void handle(MouseEvent e) {
    innerPane.setStyle("-fx-background-color:green");
   }
  };
  innerPane.setOnMouseEntered(mouseEntered);
  innerPane.setOnMouseExited(mouseExited);
  wrapper.getChildren().add(innerPane);
  Label lb = new Label("\n\n\n\t\t\t\t+\n\nPress mouse here and enter the green pane:\n it does not detect!"
    + " i want it to detect mouse entered \nregardless of mouse pressed or not! HOW?");
  wrapper.getChildren().add(lb);
  primarysStage.show();
 }

 public static void main(String[] args) {
  launch(args);
 }
}</code></pre>
</div>
</div>
</p>