当前位置: 首页>>代码示例>>Java>>正文


Java StackPane.setStyle方法代码示例

本文整理汇总了Java中javafx.scene.layout.StackPane.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java StackPane.setStyle方法的具体用法?Java StackPane.setStyle怎么用?Java StackPane.setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.StackPane的用法示例。


在下文中一共展示了StackPane.setStyle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: alert

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
/**
 *
 * Creates a scene, that has a label with a message, and is modal
 *
 * @param alertMSG String to be turned into a label
 */
protected void alert(String alertMSG){

    Label label = new Label(alertMSG);
    label.setFont(new Font(20));
    label.setStyle("-fx-text-fill: white;");
    label.setFont(new Font(20));

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: #cf1020");
    stackPane.setPadding(new Insets(20,20,20,20));
    stackPane.getChildren().add(label);

    Scene scene = new Scene(stackPane);
    Main.getAlertWindow().setScene(scene);

    if (!(Main.getAlertWindow().isShowing())) Main.getAlertWindow().showAndWait();
}
 
开发者ID:TheRedSpy15,项目名称:The-Trail,代码行数:24,代码来源:AlertBox.java

示例2: wrap

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    HBox box = new HBox();
    box.setMaxWidth(Double.MAX_VALUE);
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:17,代码来源:HelloWeekDayHeaderView.java

示例3: wrap

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
public Node wrap(Node node) {

    HBox box = new HBox();
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 0 20 0 20;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:19,代码来源:HelloTimeScaleView.java

示例4: wrap

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    HBox box = new HBox();
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 0 20 0 20;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:18,代码来源:HelloWeekTimeScaleView.java

示例5: wrap

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    TimeRangeView field = (TimeRangeView) node;

    Label label = new Label("Range:   " + field.getStartDate() + "    to    " + field.getEndDate());
    label.setMaxHeight(Double.MAX_VALUE);
    field.startDateProperty().addListener(it -> label.setText("Range:   " + field.getStartDate() + "    to    " + field.getEndDate()));
    field.endDateProperty().addListener(it -> label.setText("Range:   " + field.getStartDate() + "    to    " + field.getEndDate()));

    VBox box2 = new VBox(20, field, label);
    box2.setFillWidth(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    stackPane.getChildren().add(box2);

    HBox box = new HBox(stackPane);
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:24,代码来源:HelloTimeRangeView.java

示例6: wrap

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    StackPane outerPane = new StackPane();
    outerPane.setStyle("-fx-padding: 20px;");

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    outerPane.getChildren().add(stackPane);

    StackPane.setAlignment(node, Pos.CENTER);
    stackPane.getChildren().add(node);

    return outerPane;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:16,代码来源:CalendarFXDateControlSample.java

示例7: wrap

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
protected Node wrap(Node node) {
    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    stackPane.getChildren().add(node);

    HBox box = new HBox();
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);
    box.getChildren().add(stackPane);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:13,代码来源:CalendarFXSample.java

示例8: configureBox

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBox(HBox root) {
	StackPane container = new StackPane();
	//container.setPrefHeight(700);
	container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight());
	container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;");

	table= new TableView<AttClass>();
	Label lview= new Label();
	lview.setText("View Records");
	lview.setId("lview");
	bottomPane= new VBox();

	tclock= new Text(); 
	tclock.setId("lview");
	//tclock.setFont(Font.font("Calibri", 20));
	final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {  
		@Override  
		public void handle(ActionEvent event) {  
			tclock.setText(DateFormat.getDateTimeInstance().format(new Date()));
		}  
	}));  
	timeline.setCycleCount(Animation.INDEFINITE);  
	timeline.play();

	bottomPane.getChildren().addAll(tclock,lview);
	bottomPane.setAlignment(Pos.CENTER);

	//table pane
	namecol= new TableColumn<>("First Name");
	namecol.setMinWidth(170);
	namecol.setCellValueFactory(new PropertyValueFactory<>("name"));

	admcol= new TableColumn<>("Identication No.");
	admcol.setMinWidth(180);
	admcol.setCellValueFactory(new PropertyValueFactory<>("adm"));

	typecol= new TableColumn<>("Type");
	typecol.setMinWidth(130);
	typecol.setCellValueFactory(new PropertyValueFactory<>("type"));

	timecol= new TableColumn<>("Signin");
	timecol.setMinWidth(140);
	timecol.setCellValueFactory(new PropertyValueFactory<>("timein"));

	datecol= new TableColumn<>("Date");
	datecol.setMinWidth(180);
	datecol.setCellValueFactory(new PropertyValueFactory<>("date"));

	table.getColumns().addAll(namecol, admcol, typecol, timecol, datecol);
	table.setItems(getAtt());
	att= getAtt();
	table.setItems(FXCollections.observableArrayList(att));
	table.setMinHeight(500);

	btnrefresh = new Button("Refresh");
	btnrefresh.setOnAction(new EventHandler<ActionEvent>() {
		public void handle(ActionEvent t) {
			table.setItems(getAtt());
		}
	});
	laytable= new VBox(10);
	laytable.getChildren().addAll(table, btnrefresh);
	laytable.setAlignment(Pos.TOP_LEFT);

	container.getChildren().addAll(bottomPane,laytable);
	setAnimation();
	sc.setContent(container);
	root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)");
	root.getChildren().addAll(getActionPane(),sc);

	//service.start();
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:74,代码来源:AllAttendance.java

示例9: configureBox

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBox(HBox root) {
	  StackPane container = new StackPane();
	  //container.setPrefHeight(700);
	  container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight());
	  container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;");

	 table= new TableView<OfficeClass>();
	  Label lview= new Label();
	  lview.setText("View Records");
	  lview.setId("lview");
	  bottomPane= new VBox();
	  
	  tclock= new Text(); 
	  tclock.setId("lview");
		//tclock.setFont(Font.font("Calibri", 20));
		final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {  
		     @Override  
		     public void handle(ActionEvent event) {  
		          tclock.setText(DateFormat.getDateTimeInstance().format(new Date()));
		     }  
		}));  
		timeline.setCycleCount(Animation.INDEFINITE);  
		timeline.play();
	  
	  bottomPane.getChildren().addAll(tclock, lview);
	  bottomPane.setAlignment(Pos.CENTER);
	  
	  nocol= new TableColumn<>("no");
	  nocol.setMinWidth(130);
	  nocol.setCellValueFactory(new PropertyValueFactory<>("no"));
		
	  
	  namecol= new TableColumn<>("First Name");
		namecol.setMinWidth(170);
		namecol.setCellValueFactory(new PropertyValueFactory<>("name"));
		
		admcol= new TableColumn<>("Admission Number");
		admcol.setMinWidth(180);
		admcol.setCellValueFactory(new PropertyValueFactory<>("adm"));
		
		
		timecol= new TableColumn<>("Signin");
		timecol.setMinWidth(140);
		timecol.setCellValueFactory(new PropertyValueFactory<>("timein"));
		
		datecol= new TableColumn<>("Date");
		datecol.setMinWidth(180);
		datecol.setCellValueFactory(new PropertyValueFactory<>("date"));
		
		table.getColumns().addAll(nocol,namecol, admcol, timecol, datecol);
		table.setItems(getAtt());
		att= getAtt();
        table.setItems(FXCollections.observableArrayList(att));
        table.setMinHeight(500);
       
        btnrefresh = new Button("Refresh");
        btnrefresh.setOnAction(new EventHandler<ActionEvent>() {
            public void handle(ActionEvent t) {
            	table.setItems(getAtt());
            }
        });
        laytable= new VBox(10);
        laytable.getChildren().addAll(table, btnrefresh);
        laytable.setAlignment(Pos.TOP_LEFT);
        
        container.getChildren().addAll(bottomPane,laytable);
		setAnimation();
		sc.setContent(container);
		root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)");
		root.getChildren().addAll(getActionPane(),sc);
		
		//service.start();
	 }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:75,代码来源:Office_Entry.java

示例10: start

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
    double[] values = new double[]{50,166,200,106,94,211,172,133,132,185,152,131,158,180,172,314,262,160};

    //---->Default graph using plotter<----
    LineGraph graph = new LineGraph(400,200, Theme.TRAFFIC);
    graph.setInterval(20);

    //Populating the graph
    for (double value : values) {
        graph.addValue(value);
    }

    graph.render(LineGraph.Render.ALL);

    StackPane background = new StackPane();
    background.setPrefHeight(300);
    background.setPrefWidth(600);
    background.setStyle("-fx-background-color: radial-gradient(center 50% 50%, radius 100%, #2a367f, #1f2756)");

    background.getChildren().add(graph);
    StackPane.setAlignment(graph, Pos.CENTER);

    StackPane axis = new StackPane();
    axis.setMaxSize(500,50);
    Line divider = new Line(50,0,550,0);
    divider.setStroke(Color.WHITE);
    divider.setOpacity(0.3);
    axis.getChildren().add(divider);
    StackPane.setAlignment(divider,Pos.CENTER);
    Label time1 = new Label("8am");
    Label time2 = new Label("5pm");
    time1.setTextFill(Color.WHITE);
    time2.setTextFill(Color.WHITE);
    time1.setOpacity(0.5);
    time2.setOpacity(0.5);
    time1.setFont(Font.font("Calibri",16));
    time2.setFont(Font.font("Calibri",16));
    axis.getChildren().addAll(time1,time2);
    StackPane.setAlignment(time1,Pos.BOTTOM_LEFT);
    StackPane.setMargin(time1, new Insets(0,0,0,30));
    StackPane.setAlignment(time2, Pos.BOTTOM_RIGHT);
    StackPane.setMargin(time2, new Insets(0,30,0,0));

    background.getChildren().add(axis);
    StackPane.setAlignment(axis, Pos.BOTTOM_CENTER);
    StackPane.setMargin(axis, new Insets(0,0,40,0));

    primaryStage.setScene(new Scene(background));
    primaryStage.setTitle("Traffic");
    primaryStage.show();
}
 
开发者ID:DrMerfy,项目名称:GraphCreator,代码行数:53,代码来源:Traffic.java

示例11: createRootPane

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
public static StackPane createRootPane()
{
	StackPane root = new StackPane();
	root.setStyle("-fx-background-color: black");
	return root;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:7,代码来源:JavaFxHelper.java

示例12: createStackPane

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
public static StackPane createStackPane(double width, double height, String style)
{
	StackPane pane = createStackPane(width, height);
	pane.setStyle(style);
	return pane;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:7,代码来源:JavaFxHelper.java


注:本文中的javafx.scene.layout.StackPane.setStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。