Skip to content

Instantly share code, notes, and snippets.

@guigarage
guigarage / gist:e9807629080fd1dc6143
Created September 16, 2014 17:06
Set Font in JavaFX
Button b = new Button("Text");
b.setFont(new Font("Arial", 24));
@guigarage
guigarage / gist:5e7be32afbf555cc9f4b
Last active August 29, 2015 14:06
JavaFX: Define a font in CSS
#my-button {
-fx-font-family: "Arial";
-fx-font-size: 24;
}
@guigarage
guigarage / gist:394ff78501d059cf2670
Created September 16, 2014 17:20
Define a font for a JavaFX application by CSS
.text {
-fx-font-family: "Asap";
}
@guigarage
guigarage / gist:6ea110b098222ae0c83c
Created September 16, 2014 17:33
Add a custom font to a JavaFX application by using CSS
@font-face {
font-family: 'Roboto';
src: url('Roboto-Medium.ttf');
}
.text {
-fx-font-family: "Roboto";
}
@guigarage
guigarage / gist:448769aebefcaedda915
Created September 16, 2014 17:41
Dependency of responsivefx
<dependency>
<groupId>com.guigarage</groupId>
<artifactId>responsivefx</artifactId>
<version>X.Y</version>
</dependency>
@guigarage
guigarage / gist:30f3b81d87e1e8173f1c
Created September 16, 2014 17:49
usage of responsive style classes in html
<div class="hidden-xs">big text<div>
<div class="visible-xs">small text<div>
@guigarage
guigarage / gist:f58699fd66034303e61a
Created September 16, 2014 17:52
Adding responsive design to JavaFX
ResponsiveHandler.addResponsiveToWindow(primaryStage);
@guigarage
guigarage / gist:29ca2843a3f644ae8fcb
Created September 16, 2014 17:54
using responsive design style classes in JavaFX
TableView table = new TableView(items);
table.getStyleClass().addAll("visible-lg", "visible-md");
ListView list = new ListView(items);
list.getStyleClass().addAll("visible-xs", "visible-sm");
pane.getChildren().addAll(table, list);
@guigarage
guigarage / gist:8c97bfc084e40546eae6
Created September 16, 2014 18:05
responsive design html
<div class="visible-xs">...<div> <!--extra small-->
<div class="visible-sm">...<div> <!--small-->
<div class="visible-md">...<div> <!--medium-->
<div class="visible-lg">...<div> <!--large-->
@guigarage
guigarage / gist:d5b5127d368916e8978e
Created September 16, 2014 18:08
responsive design JavaFX
Toolbar extraSmallToolbar = new Toolbar(...);
extraSmallToolbar.getStyleClass().add("visible-xs");
Toolbar smallToolbar = new Toolbar(...);
smallToolbar.getStyleClass().add("visible-sm");
Toolbar mediumToolbar = new Toolbar(...);
mediumToolbar.getStyleClass().add("visible-md");
Toolbar largeToolbar = new Toolbar(...);