In JavaFx, we can apply CSS style to the nodes. For example, if we want to define a style for the buttons, the style sheet will have the selector named as ‘.button’. The same way, TextField defines a UI class in JavaFx, and the selector will be named as ‘.text-field’. Note, as text field control is a two-word class, in the selector we will have a hyphen. When defining the rules, we must prefix each rule with ‘-fx-‘. In this example, we will define style rule for a JavaFx Button.
Tag Archive for ‘getResource’
The example is a simple JFrame, which houses a JEditorPane in it. The editor pane is displaying a html table above and the user can scroll the document using the scrollbars. These scrolls are useful when the document is bigger than the editor pane. Now, we will proceed with the example.