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


Java StackPane.autosize方法代碼示例

本文整理匯總了Java中javafx.scene.layout.StackPane.autosize方法的典型用法代碼示例。如果您正苦於以下問題:Java StackPane.autosize方法的具體用法?Java StackPane.autosize怎麽用?Java StackPane.autosize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.layout.StackPane的用法示例。


在下文中一共展示了StackPane.autosize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: show

import javafx.scene.layout.StackPane; //導入方法依賴的package包/類
public void show() {
	textArea = new JFXTextArea(bodyText);
	
	JFXDialogLayout content = new JFXDialogLayout();
	content.setHeading(new Text(headingText));
	content.setBody(textArea);
	content.setPrefSize(dialogWidth, dialogHeight);
	StackPane stackPane = new StackPane();
	stackPane.autosize();
	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
	JFXButton button = new JFXButton("Okay");
	button.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			dialog.close();
		}
	});
	button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
	button.setPrefHeight(32);
	button.setStyle(dialogBtnStyle);
	content.setActions(button);
	pane.getChildren().add(stackPane);
	AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
	dialog.show();
}
 
開發者ID:Seil0,項目名稱:cemu_UI,代碼行數:27,代碼來源:JFXTextAreaInfoDialog.java

示例2: show

import javafx.scene.layout.StackPane; //導入方法依賴的package包/類
public void show() {
	JFXDialogLayout content = new JFXDialogLayout();
	content.setHeading(new Text(headingText));
	content.setBody(new Text(bodyText));
	content.setPrefSize(dialogWidth, dialogHeight);
	StackPane stackPane = new StackPane();
	stackPane.autosize();
	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
	JFXButton button = new JFXButton("Okay");
	button.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			dialog.close();
		}
	});
	button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
	button.setPrefHeight(32);
	button.setStyle(dialogBtnStyle);
	content.setActions(button);
	pane.getChildren().add(stackPane);
	AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
	dialog.show();
}
 
開發者ID:Seil0,項目名稱:cemu_UI,代碼行數:25,代碼來源:JFXInfoDialog.java

示例3: show

import javafx.scene.layout.StackPane; //導入方法依賴的package包/類
public void show() {
	
	JFXDialogLayout content = new JFXDialogLayout();
   	content.setHeading(new Text(headingText));
   	content.setBody(new Text(bodyText));
   	StackPane stackPane = new StackPane();
   	stackPane.autosize();
   	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
   	JFXButton okayBtn = new JFXButton(okayText);
   	okayBtn.addEventHandler(ActionEvent.ACTION, (e)-> {
   		dialog.close();
   	});
   	okayBtn.addEventHandler(ActionEvent.ACTION, okayAction);
   	okayBtn.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
   	okayBtn.setPrefHeight(32);
   	okayBtn.setStyle(dialogBtnStyle);
   	JFXButton cancelBtn = new JFXButton(cancelText);
   	cancelBtn.addEventHandler(ActionEvent.ACTION, (e)-> {
   		dialog.close();
   	});
   	cancelBtn.addEventHandler(ActionEvent.ACTION, cancelAction);
   	cancelBtn.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
   	cancelBtn.setPrefHeight(32);
   	cancelBtn.setStyle(dialogBtnStyle);
   	content.setActions(cancelBtn, okayBtn);
   	content.setPrefSize(dialogWidth, dialogHeight);
   	pane.getChildren().add(stackPane);
   	AnchorPane.setTopAnchor(stackPane, (pane.getHeight()-content.getPrefHeight())/2);
   	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth()-content.getPrefWidth())/2);
   	dialog.show();
}
 
開發者ID:Seil0,項目名稱:cemu_UI,代碼行數:32,代碼來源:JFXOkayCancelDialog.java


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