2

I'm trying to remove the page corner from a tool tip but I'm failing to get the CSS to stick.

My Code Looks like:

public class PinRender extends StackPane {

private Shape shape;
private Text textNode;
private String text;

public PinRender(Shape shape) {
    this.shape = shape;
    this.textNode = new Text();
    this.text = "";
    this.getChildren().add(shape);
    this.getChildren().add(textNode);
    this.getStylesheets().add(PinRender.class.getResource("ToolTipStyle.css").toExternalForm());

    Tooltip tooltip = new Tooltip("ToolTips are the best!");
    tooltip.getStyleClass().add("ttip");

    Tooltip.install(this, tooltip);
}

public void setColor(Color c) {
    shape.setFill(c);
}
}

And my CSS looks like:

.ttip{
     -fx-background-radius: 0 0 0 0;
     -fx-background-color:  linear-gradient(white,whitesmoke);
}

.page-corner {
    -fx-shape: " ";
}

But I am still getting the default ugly yellow with the folded page corner.

Am I trying to use my CSS incorrectly?

4

1 回答 1

3
.page-corner {
    -fx-background-color: transparent;
}
于 2013-11-13T20:41:43.073 回答