本文整理匯總了Java中javafx.scene.control.TableColumn.setResizable方法的典型用法代碼示例。如果您正苦於以下問題:Java TableColumn.setResizable方法的具體用法?Java TableColumn.setResizable怎麽用?Java TableColumn.setResizable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.control.TableColumn
的用法示例。
在下文中一共展示了TableColumn.setResizable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initTimeline
import javafx.scene.control.TableColumn; //導入方法依賴的package包/類
private void initTimeline(LocalDate start, LocalDate end) {
this.timelineStart = start;
this.timelineEnd = end;
for(int m = start.getMonthValue(); m <= end.getMonthValue(); m++) {
TableColumn<GanttTask,GanttBarPiece> monthCol = new TableColumn<GanttTask,GanttBarPiece>();
Label month = new Label(Month.of(m).toString());
monthCol.setGraphic(month);
monthCol.setResizable(false);
LocalDate tmp = LocalDate.of(start.getYear(), m, 1);
LocalDate chartStart = start.compareTo(tmp) > 0 ? start : tmp;
for(int d = chartStart.getDayOfMonth(); d <= chartStart.lengthOfMonth(); d++) {
GanttDayColumn c = new GanttDayColumn(chartStart.getYear(), m, d);
c.setPrefWidth(20);
Label day = new Label(Integer.toString(d));
c.setGraphic(day);
monthCol.getColumns().add(c);
}
this.getColumns().add(monthCol);
}
// TODO make timeline right-left scrollable with wheel on windows
}
示例2: createColumns
import javafx.scene.control.TableColumn; //導入方法依賴的package包/類
private void createColumns() {
TableColumn<RequestEntry, String> eventTypeCol = new TableColumn("Type");
eventTypeCol.setMinWidth(100);
eventTypeCol.setCellValueFactory(new PropertyValueFactory<>("eventType"));
eventTypeCol.setSortable(false);
TableColumn<RequestEntry, String> eventNameCol = new TableColumn("Name");
eventNameCol.setMinWidth(100);
eventNameCol.setCellValueFactory(new PropertyValueFactory<>("eventName"));
eventNameCol.setSortable(false);
TableColumn<RequestEntry, String> eventDateTimeCol = new TableColumn("Time");
eventDateTimeCol.setMinWidth(200);
eventDateTimeCol.setCellValueFactory(new PropertyValueFactory<>("eventDateTime"));
eventDateTimeCol.setSortable(false);
TableColumn<RequestEntry, String> eventLocationCol = new TableColumn("Location");
eventLocationCol.setMinWidth(100);
eventLocationCol.setCellValueFactory(new PropertyValueFactory<>("eventLocation"));
eventLocationCol.setSortable(false);
TableColumn<RequestEntry, String> eventConductorCol = new TableColumn("Conductor");
eventConductorCol.setMinWidth(100);
eventConductorCol.setCellValueFactory(new PropertyValueFactory<>("eventConductor"));
eventConductorCol.setSortable(false);
TableColumn<RequestEntry, RequestTypeGUI> requestTypeCol = new TableColumn("Request");
requestTypeCol.setCellFactory((param) -> new RequestRadioButtonCell<>(EnumSet.allOf(RequestTypeGUI.class)));
requestTypeCol.setCellValueFactory(new PropertyValueFactory<>("requestType"));
requestTypeCol.setSortable(false);
TableColumn<RequestEntry, TextField> eventDescriptionCol = new TableColumn("Description");
eventDescriptionCol.setMinWidth(300);
eventDescriptionCol.setCellValueFactory(new PropertyValueFactory<RequestEntry, TextField>("requestDescription"));
eventDescriptionCol.setResizable(false);
eventDescriptionCol.setSortable(false);
table.getColumns().addAll(eventTypeCol, eventNameCol, eventDateTimeCol, eventLocationCol, eventConductorCol, requestTypeCol, eventDescriptionCol);
}
示例3: PlayerListTable
import javafx.scene.control.TableColumn; //導入方法依賴的package包/類
public PlayerListTable(ObservableList<PlayerView> players) {
super();
TableColumn<PlayerView, Integer> id = new TableColumn<>("ID");
TableColumn<PlayerView, String> name = new TableColumn<>("Name");
TableColumn<PlayerView, HBox> steamId = new TableColumn<>("Steam ID");
TableColumn<PlayerView, String> vacBans = new TableColumn<>("VAC");
TableColumn<PlayerView, HBox> actions = new TableColumn<>("Actions");
id.setCellValueFactory(new PropertyValueFactory<>("id"));
name.setCellValueFactory(new PropertyValueFactory<>("name"));
steamId.setCellValueFactory(new PropertyValueFactory<>("steamPan"));
vacBans.setCellValueFactory(new PropertyValueFactory<>("vacBans"));
actions.setCellValueFactory(new PropertyValueFactory<>("actionPan"));
id.setMaxWidth(25);
id.setMinWidth(25);
steamId.setMinWidth(220);
steamId.setMaxWidth(220);
vacBans.setMaxWidth(50);
vacBans.setMinWidth(50);
actions.setMinWidth(80);
actions.setMaxWidth(80);
id.setResizable(false);
steamId.setResizable(false);
actions.setResizable(false);
vacBans.setResizable(false);
this.getColumns().add(id);
this.getColumns().add(name);
this.getColumns().add(steamId);
this.getColumns().add(vacBans);
this.getColumns().add(actions);
this.getColumns().forEach(c -> {
c.setStyle(DEFAULT_STYLE);
});
this.players = players;
this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
this.setPrefHeight(1000000);
this.setItems(this.players);
}