@Override public void initialize() { disputesTable = new TableView<>(); VBox.setVgrow(disputesTable, Priority.SOMETIMES); disputesTable.setMinHeight(150); root.getChildren().add(disputesTable); TableColumn<Dispute, Dispute> tradeIdColumn = getTradeIdColumn(); disputesTable.getColumns().add(tradeIdColumn); TableColumn<Dispute, Dispute> roleColumn = getRoleColumn(); disputesTable.getColumns().add(roleColumn); TableColumn<Dispute, Dispute> dateColumn = getDateColumn(); disputesTable.getColumns().add(dateColumn); TableColumn<Dispute, Dispute> contractColumn = getContractColumn(); disputesTable.getColumns().add(contractColumn); TableColumn<Dispute, Dispute> stateColumn = getStateColumn(); disputesTable.getColumns().add(stateColumn); disputesTable.getSortOrder().add(dateColumn); disputesTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); Label placeholder = new Label("There are no open tickets"); placeholder.setWrapText(true); disputesTable.setPlaceholder(placeholder); disputesTable.getSelectionModel().clearSelection(); disputeChangeListener = (observableValue, oldValue, newValue) -> onSelectDispute(newValue); }
public static Label addMultilineLabel(GridPane gridPane, int rowIndex, String text, double top) { Label label = new Label(text); label.setWrapText(true); GridPane.setHalignment(label, HPos.LEFT); GridPane.setRowIndex(label, rowIndex); GridPane.setColumnSpan(label, 2); GridPane.setMargin(label, new Insets(top, 0, 0, 0)); gridPane.getChildren().add(label); return label; }
public FileGridCell() { Label titleLabel = new Label(); titleLabel.setPrefWidth(80); titleLabel.setWrapText(true); titleLabel.setTextAlignment(TextAlignment.CENTER); title = titleLabel.textProperty(); ImageView iconView = new ImageView(); icon = iconView.imageProperty(); VBox vbox = new VBox(iconView, titleLabel); vbox.setAlignment(Pos.TOP_CENTER); setGraphic(vbox); }
/** Set the Labels */ protected void setLabels() { mLabels = new HashMap<String, Label>(); mValues = new HashMap<String, Label>(); for (String name : mLabelNames) { Label newLabel1 = new Label(name); Label newLabel2 = new Label(); newLabel1.setFont(new Font("Arial", 20)); newLabel2.setFont(new Font("Arial", 20)); mLabels.put(name, newLabel1); mValues.put(name, newLabel2); } Label upgradeLabel = new Label(mUpgradeName); upgradeLabel.setFont(new Font("Arial", 25)); upgradeLabel.setWrapText(true); mLabels.put(mUpgradeName, upgradeLabel); update(); }