Archive for category CSS

Customize ScrollBar via CSS

Hello friends,

I came today with new stuffs of customizing the scrollbar control in JavaFX after long duration. :)
First Let’s look over what are the parts of ScrollBar as given in below image below.

 

ScrollBar parts CSS information

 

In the above picture there are four main part of ScrollBar .

  • increment
  • thumb
  • track
  • decrement

Read the rest of this entry »

Tags: , , , , , ,

Form field validation styles from CSS

Hello guys,
After a long days gaps I’m back on my favourite blog. I’m preety glad to know that Oracle has launched the new JavaFX Scene Builder. If you have not started then please give it a try. You can download the Scene Builder from here:

Ok Now lets go to the main stuffs of today’s post. I’ve been working on CSS stuff and it’s being so interesting to use in JavaFX which is more easier to design the controls and make the design more interactive in Application for the end-user. In the real world application we may need the form to fill up from the javafx and when ever there comes the form then the validation is one of the important part of form. Every field in the form need the validation for making the proper data entry.

Let’s start with small Textfield validation with the simple app.
Read the rest of this entry »

Tags: , , , , ,

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.

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 the rest of this entry »

Tags: , , , , ,