當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollPane.setMinHeight方法代碼示例

本文整理匯總了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;
}
 
開發者ID:PolyphasicDevTeam,項目名稱:NoMoreOversleeps,代碼行數:15,代碼來源:JavaFxHelper.java

示例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);
}
 
開發者ID:deadlocker8,項目名稱:BudgetMaster,代碼行數:62,代碼來源:TagField.java


注:本文中的javafx.scene.control.ScrollPane.setMinHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。