Search in sources :

Example 1 with AwesomeIcon

use of de.jensd.fx.fontawesome.AwesomeIcon in project bitsquare by bitsquare.

the class AwesomeFontDemo method start.

@Override
public void start(Stage primaryStage) {
    Pane root = new FlowPane();
    List<AwesomeIcon> values = new ArrayList<>(Arrays.asList(AwesomeIcon.values()));
    values.sort(new Comparator<AwesomeIcon>() {

        @Override
        public int compare(AwesomeIcon o1, AwesomeIcon o2) {
            return o1.name().compareTo(o2.name());
        }
    });
    for (AwesomeIcon icon : values) {
        Label label = new Label();
        Button button = new Button(icon.name(), label);
        AwesomeDude.setIcon(label, icon);
        root.getChildren().add(button);
    }
    primaryStage.setScene(new Scene(root, 900, 850));
    primaryStage.show();
}
Also used : Button(javafx.scene.control.Button) ArrayList(java.util.ArrayList) Label(javafx.scene.control.Label) FlowPane(javafx.scene.layout.FlowPane) Scene(javafx.scene.Scene) FlowPane(javafx.scene.layout.FlowPane) Pane(javafx.scene.layout.Pane) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon)

Aggregations

AwesomeIcon (de.jensd.fx.fontawesome.AwesomeIcon)1 ArrayList (java.util.ArrayList)1 Scene (javafx.scene.Scene)1 Button (javafx.scene.control.Button)1 Label (javafx.scene.control.Label)1 FlowPane (javafx.scene.layout.FlowPane)1 Pane (javafx.scene.layout.Pane)1