How to create good-looking tooltip with small arrow on the corner in javafx?

馋奶兔 提交于 2019-12-11 03:16:50

问题


I want to create cool Tooltip that can be displayed programmatically and on desired location.

I have seen Tooltips in javaFx but I need to popup nice tooltip that has arrow that points to TextField.

I need tooltip like the one on stackoverflow :

Maybe someone have done that before or know how to do it?

Thank you!


回答1:


i think this would help you.

.tooltip {
-fx-skin: "com.sun.javafx.scene.control.skin.TooltipSkin";
-fx-background-color:
    linear-gradient(#cec340, #a59c31),
    linear-gradient(#fefefc, #e6dd71),
    linear-gradient(#fef592, #e5d848);
-fx-background-insets: 0,1,2;
-fx-background-radius: 0 0 13 0;
-fx-padding: 0.333333em 0.666667em 0.333333em 0.666667em; /* 4 8 4 8 */
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 8, 0.0 , 0 , 0 );
}
.page-corner {
-fx-padding: 4.5 4.5 4.5 4.5;
-fx-background-color: linear-gradient( from 0% 0% to 50% 50%, #fcf7b6, #a59c31);
-fx-shape: "M0,0H9L0,9Z";
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 4 , 0.0 , 0 , 0 );
}


来源:https://stackoverflow.com/questions/19118145/how-to-create-good-looking-tooltip-with-small-arrow-on-the-corner-in-javafx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!