CSS : Tooltip Skinning
Hello I’m back with the small css skinning for the Tooltip.
Firstly the idea of this blogging came from this forum post. One guy was posting about how to make the tooltip plain as of swing which is concern about the css skinning.
First let’s get start with the normal tooltip example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
public class TooltipTest extends Application { public static void main(String[] args) { Application.launch(TooltipTest.class, args); } @Override public void start(Stage primaryStage) throws Exception { StackPane stackPane = new StackPane(); Button butt = new Button("Test hello"); Tooltip tp= new Tooltip("Hello this is only the test"); tp.getStyleClass().add("ttip"); butt.setTooltip(tp); stackPane.getChildren().add(butt); Scene sc = new Scene(stackPane,500,500); sc.getStylesheets().add(getClass().getResource("gui.css").toExternalForm()); primaryStage.setScene(sc); primaryStage.show(); } } |
Here I’ve added my custom css file ‘gui.css’ for styling this application.
Read More »CSS : Tooltip Skinning