B4J Question Flat controls

Daestrum

Well-Known Member
Licensed User
An example (but looks horrid) not sure how many controls it contains.
B4X:
 ' download jmetro-5.2.jar and save in additional libraries folder
 ' include  #AdditionalJar: jmetro-5.2.jar
...
 Dim theme As JavaObject
 theme.InitializeNewInstance("jfxtras.styles.jmetro8.JMetro",Array("LIGHT"))' or DARK
 theme.RunMethod("applyTheme",Array(MainForm.RootPane)) ' apply to rootpane ie everything
...
 

Erel

Administrator
Staff member
Licensed User
Source: https://stackoverflow.com/questions/21451386/titled-pane-css-settings
This will help you get started:

Create a css file named style.css with:
B4X:
.titled-pane > .title
{
-fx-background-color: -fx-box-border, -fx-inner-border, white;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-padding: 0.166667em 0.833333em 0.25em 0.833333em; /* 2 10 3 10 */
}
Set it with:
B4X:
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "style.css"))
 
Top