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


Java ScrollPane.setPadding方法代码示例

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


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

示例1: MonthBarChart

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
public MonthBarChart(ArrayList<MonthInOutSum> monthInOutSums, String currency)
{
	if(monthInOutSums == null)
	{
		this.monthInOutSums = new ArrayList<>();
	}
	else
	{
		this.monthInOutSums = monthInOutSums;
	}
	this.currency = currency;	
	
	ScrollPane scrollPane = new ScrollPane();
       scrollPane.setVbarPolicy(ScrollBarPolicy.NEVER);
       scrollPane.setFocusTraversable(false);
       scrollPane.setStyle("-fx-background-color: transparent; -fx-background-insets: 0; -fx-border-color: transparent; -fx-border-width: 0; -fx-border-insets: 0;");
       scrollPane.setPadding(new Insets(0, 0, 10, 0));
      
       HBox generatedChart = generate();              
       scrollPane.setContent(generatedChart);
       generatedChart.prefHeightProperty().bind(scrollPane.heightProperty().subtract(30));
       this.getChildren().add(scrollPane);
       VBox.setVgrow(scrollPane, Priority.ALWAYS);
       
       this.getChildren().add(generateLegend());
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:27,代码来源:MonthBarChart.java

示例2: productbyType

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
public static BorderPane productbyType(String type) {

        BorderPane products = new BorderPane();
        products.setPadding(new Insets(10,20,10,20));

        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;

        String query = DBUtils.prepareSelectQuery(" * ",
                " classroomflipkart.productdetail AS T ," +
                        " ( "+ DBUtils.prepareSelectQuery("productId",
                                " classroomflipkart.homeproducts ",
                                "type = '"+type+"'")+
                        " ) AS S",
                " T.productId = S.productId ");

        try {
            con = DBUtils.getConnection();
            stmt = con.prepareStatement(query);
            rs = stmt.executeQuery();

            rs.last();
            int size = rs.getRow();

            if (size>0){
                rs.beforeFirst();

                Label title = new Label(type+"");
                title.setFont(Font.font("Open Sans", FontWeight.BOLD,17));
                title.setPadding(new Insets(10));
                title.setAlignment(Pos.CENTER);

                HBox productList = new HBox(20);
                productList.setAlignment(Pos.CENTER);

                while (rs.next()) {
                    String productId = rs.getString("productId");
                    String productName = rs.getString("productName");
                    String newPrice = rs.getString("newPrice");
                    String oldPrice = rs.getString("oldPrice");
                    String category = rs.getString("category");
                    String subcategory = rs.getString("subcategory");
                    String imageName = rs.getString("imageName");
                    String productAvailability = rs.getString("productAvailability");

                    productList.getChildren().add(productDetail.productByType(productId,productName,newPrice,oldPrice,category,subcategory,imageName, productAvailability));
                }

                ScrollPane proScroller = new ScrollPane(productList);
                proScroller.setFitToHeight(true);
                proScroller.setFitToWidth(true);
                proScroller.setPannable(true);
                proScroller.setPadding(new Insets(0,0,30,0));

                StackPane titlePane = new StackPane(title);
                titlePane.setAlignment(Pos.CENTER);

                StackPane productPane = new StackPane(proScroller);
                productPane.setAlignment(Pos.CENTER);

                products.setTop(titlePane);
                products.setCenter(productPane);
            }


        } catch (Exception e) {
            products.setCenter(new Label(e.getMessage()));
            e.printStackTrace();
        } finally {
            DBUtils.closeAll(rs, stmt, con);
            return products;
        }
    }
 
开发者ID:madHEYsia,项目名称:ClassroomFlipkart,代码行数:75,代码来源:fetchProducts.java

示例3: wrapForScroll

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
protected ScrollPane wrapForScroll(Pane rootGrid) {
	ScrollPane scrollPane = new ScrollPane(rootGrid);
	scrollPane.setPadding(new Insets(0));
	scrollPane.setFitToWidth(true);
	scrollPane.setFitToHeight(true);
	return scrollPane;
}
 
开发者ID:CedricReichenbach,项目名称:audiomerge,代码行数:8,代码来源:Page.java


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