當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。