I’m trying to use http://fxexperience.com/controlsfx/features/#decorationvalidation in my project, but probably miss something very obvious, thus the question.
If my control has a tooltip, the tooltip of a validation decoration is completely obscured by the tooltip of the control. How do I give the tooltip of the validation decoration some more priority?
package de.oowv.application;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.controlsfx.validation.ValidationResult;
import org.controlsfx.validation.ValidationSupport;
import org.controlsfx.validation.decoration.GraphicValidationDecoration;
public class Tmp extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
TextField text = new TextField();
text.setTooltip(new Tooltip("Text tooltip"));
VBox root = new VBox(10, text);
root.setPadding(new Insets(20));
ValidationSupport vs = new ValidationSupport();
vs.setValidationDecorator(new GraphicValidationDecoration());
vs.registerValidator(text, false, (c, v) -> ValidationResult.fromError(c, "Error"));
text.setText("MMm");
primaryStage.setScene(new Scene(root, 300, 100));
primaryStage.show();
}
}
I do get:
tooltip of the control over validation icon
My expectation would be:
validation tooltip over validation decoration
Slava is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.