当前位置: 首页>>代码示例>>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;未经允许,请勿转载。