Java Code Examples for javafx.scene.control.Button#setMinHeight()

The following examples show how to use javafx.scene.control.Button#setMinHeight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetaDeckView.java    From metastone with GNU General Public License v2.0 6 votes vote down vote up
public void displayDecks(List<Deck> decks) {
	contentPane.getChildren().clear();
	for (Deck deck : decks) {
		if (deck.isMetaDeck()) {
			continue;
		}
		ImageView graphic = new ImageView(IconFactory.getClassIcon(deck.getHeroClass()));
		graphic.setFitWidth(48);
		graphic.setFitHeight(48);
		Button deckButton = new Button(deck.getName(), graphic);
		deckButton.setMaxWidth(160);
		deckButton.setMinWidth(160);
		deckButton.setMaxHeight(120);
		deckButton.setMinHeight(120);
		deckButton.setWrapText(true);
		deckButton.setContentDisplay(ContentDisplay.LEFT);
		deckButton.setOnAction(event -> NotificationProxy.sendNotification(GameNotification.ADD_DECK_TO_META_DECK, deck));
		deckButton.setUserData(deck);
		contentPane.getChildren().add(deckButton);
	}
}
 
Example 2
Source File: BigButtonDemo.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void start(Stage primaryStage) {
    Button btn = new Button();
    btn.setText("Alpha Base" + System.lineSeparator() + "Population : 8");
    btn.setGraphic(new Rectangle(30,30, Color.RED));
    btn.setMinHeight(200);
    btn.setMinWidth(250);
    //btn.setStyle("-fx-alignment: LEFT;");
    btn.setAlignment(Pos.BASELINE_LEFT);

    StackPane root = new StackPane();
    root.getChildren().add(btn);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}
 
Example 3
Source File: Arrow.java    From LogFX with GNU General Public License v3.0 5 votes vote down vote up
public static Button arrowButton( Direction direction,
                                  EventHandler<ActionEvent> eventEventHandler,
                                  String toolTipText ) {
    Button button = new Button( "", new Arrow( direction ) );
    button.setFont( Font.font( 4.0 ) );
    button.setMinWidth( 16 );
    button.setMinHeight( 8 );
    button.setTooltip( new Tooltip( toolTipText ) );
    button.getTooltip().setFont( Font.font( 12.0 ) );
    button.setOnAction( eventEventHandler );
    return button;
}
 
Example 4
Source File: PasswordFieldPopup.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
public PasswordFieldPopupContent() {
    getStyleClass().setAll("pdfsam-input-password-content");
    passwordField.setPromptText(DefaultI18nContext.getInstance().i18n("Enter the user password"));
    Button doneButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.UNLOCK,
            DefaultI18nContext.getInstance().i18n("Unlock"));
    doneButton.getStyleClass().addAll(Style.BUTTON.css());
    doneButton.prefHeightProperty().bind(passwordField.heightProperty());
    doneButton.setMaxHeight(USE_PREF_SIZE);
    doneButton.setMinHeight(USE_PREF_SIZE);
    doneButton.setOnAction(e -> requestLoad());
    passwordField.setOnAction(e -> requestLoad());
    getChildren().addAll(passwordField, doneButton);
}