本文整理汇总了Java中javafx.scene.control.ScrollPane.setMinHeight方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPane.setMinHeight方法的具体用法?Java ScrollPane.setMinHeight怎么用?Java ScrollPane.setMinHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.ScrollPane
的用法示例。
在下文中一共展示了ScrollPane.setMinHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScrollPane
import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
public static ScrollPane createScrollPane(double width, double height, String style, String styleClass, ScrollBarPolicy hPolicy, ScrollBarPolicy vPolicy, boolean pannable)
{
ScrollPane pane = new ScrollPane();
pane.setMinWidth(width);
pane.setMaxWidth(width);
pane.setMinHeight(height);
pane.setMaxHeight(height);
pane.setStyle(style);
pane.getStyleClass().add(styleClass);
pane.hbarPolicyProperty().set(hPolicy);
pane.vbarPolicyProperty().set(vPolicy);
pane.pannableProperty().set(pannable);
return pane;
}
示例2: TagField
import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
public TagField(ArrayList<Tag> tags, ArrayList<Tag> allAvailableTags, NewPaymentController parentController)
{
this.tags = tags;
this.allTags = allAvailableTags;
this.parentController = parentController;
this.hboxTags = initHboxTags();
ScrollPane scrollPane = new ScrollPane();
scrollPane.setContent(hboxTags);
scrollPane.setVbarPolicy(ScrollBarPolicy.NEVER);
scrollPane.setMinHeight(50);
scrollPane.setStyle("-fx-background-color: #FFFFFF; -fx-background-radius: 5px; -fx-border-color: #000000; -fx-border-width: 1 1 0 1; -fx-border-radius: 5px 5px 0 0");
this.getChildren().add(scrollPane);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
textField = new TextField();
textField.setStyle("-fx-background-color: #FFFFFF; -fx-border-color: #000000; -fx-border-width: 1; -fx-background-radius: 5px; -fx-border-radius: 0 0 5px 5px");
textField.setPromptText(Localization.getString(Strings.TAGFIELD_PLACEHOLDER));
textField.setMaxWidth(Double.MAX_VALUE);
textField.setOnKeyPressed((event)->{
if(event.getCode().equals(KeyCode.ENTER))
{
addTag(textField.getText().trim());
}
else if(event.getCode().equals(KeyCode.DOWN))
{
textField.setText(" ");
textField.setText("");
}
});
textField.setOnMousePressed((event)->{
textField.setText(" ");
textField.setText("");
});
TextFields.bindAutoCompletion(textField, new Callback<AutoCompletionBinding.ISuggestionRequest, Collection<String>>()
{
@Override
public Collection<String> call(org.controlsfx.control.textfield.AutoCompletionBinding.ISuggestionRequest param)
{
ArrayList<String> completions = getCompletions(allTags);
ArrayList<String> remainingCompletions = new ArrayList<>();
for(String currentCompletion : completions)
{
if(currentCompletion.toLowerCase().contains(param.getUserText().toLowerCase()))
{
remainingCompletions.add(currentCompletion);
}
}
return remainingCompletions;
}
});
this.getChildren().add(textField);
this.setStyle("-fx-background-color: #FFFFFF; -fx-background-radius: 5px;");
refresh(false);
}