javafx.scene.control.TableColumn.setPrefWidth()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(171)

本文整理了Java中javafx.scene.control.TableColumn.setPrefWidth()方法的一些代码示例,展示了TableColumn.setPrefWidth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.setPrefWidth()方法的具体详情如下:
包路径:javafx.scene.control.TableColumn
类名称:TableColumn
方法名:setPrefWidth

TableColumn.setPrefWidth介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

fxmlController.java: 

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TableColumn;

/**
 *
 * @author William
 */
public class fxmlController implements Initializable{

  @FXML TableColumn myTableColumn;

  @Override
  public void initialize(URL url, ResourceBundle rb) {
    myTableColumn.setPrefWidth(200);
  }

}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

/**
 * Create a column
 *
 * @param label
 *            the label
 * @param prefWidth
 *            the preferred width
 * @param valueExtractor
 *            function to extract the value
 * @return the column instance
 */
public static <S, T> TableColumn<S, T> createColumn(String label, double prefWidth, Function<S, T> valueExtractor) {
  TableColumn<S, T> c = new TableColumn<>();
  c.setText(label);
  c.setPrefWidth(prefWidth);
  c.setCellValueFactory(f -> new SimpleObjectProperty<>(valueExtractor.apply(f.getValue())));
  return c;
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private void addSelectColumn() {
 headerCheckboxCol.setPrefWidth(40);
 headerCheckboxCol.setCellValueFactory(new PropertyValueFactory<>("selected"));
 headerCheckboxCol.setCellFactory(param -> buildCell());
 headerCheckboxCol.setGraphic(headerColCheckbox);
 headerCheckboxCol.setVisible(false);
 tableView.getColumns().add(0, headerCheckboxCol);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

@SuppressWarnings({"unchecked"})
private void addSelectColumn() {
 headerCheckboxCol.setPrefWidth(40);
 headerCheckboxCol.setCellValueFactory(new PropertyValueFactory<>("selected"));
 headerCheckboxCol.setCellFactory(param -> buildCell());
 headerCheckboxCol.setGraphic(headerColCheckbox);
 headerCheckboxCol.setVisible(false);
 tableView.getColumns().add(0, headerCheckboxCol);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Reload the table according to setting (colums)
 *
 * @param tableSetting
 */
public void reloadTableSetting(final VLViewTableSettingXML tableSetting) {
 final List<TableColumn> newcols = new ArrayList<>();
 for (final VLViewTableSettingColumnXML tcol : tableSetting.getColumns()) {
  for (final TableColumn col : tableView.getColumns()) {
   if (tcol.getId().equals(col.getId())) {
    col.setPrefWidth(tcol.getWidth());
    col.setVisible(tcol.isDisplayed());
    newcols.add(col);
   }
  }
 }
 tableView.getColumns().clear();
 for(TableColumn e: newcols) {
  tableView.getColumns().add(e);
 }
}

代码示例来源:origin: stackoverflow.com

tcC1.setPrefWidth(130);//set this to what you prefer.

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private TableColumn buildRootColumn() {
 final TableColumn t = new TableColumn();
 // cell value factory
 t.setCellValueFactory(param -> {
  if (((CellDataFeatures) param).getValue() instanceof OperationData) {
   final OperationData operationData = (OperationData) ((CellDataFeatures) param).getValue();
   final SimpleObjectProperty<OperationData> op = new SimpleObjectProperty();
   op.set(operationData);
   return op;
  }
  return null;
 });
 t.setPrefWidth(600);
 t.setMinWidth(600);
 // cell factory
 t.setCellFactory(arg0 -> new FlowTableCell());
 return t;
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

c.setPrefWidth(400);
c.setMinWidth(400);
c.setCellFactory((co) -> new NameTableCell());

代码示例来源:origin: org.controlsfx/controlsfx

fp.columnFilter.getTableColumn().setGraphic(filterImageView.get());
if (!bumpedWidth) {
  fp.columnFilter.getTableColumn().setPrefWidth(columnFilter.getTableColumn().getWidth() + 20);
  bumpedWidth = true;

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

c.setPrefWidth(400);
c.setMinWidth(400);
c.setCellFactory((co) -> new NameTableCell());

代码示例来源:origin: org.jrebirth.af.showcase/todos

doneColumn.setPrefWidth(40);
doneColumn.setMaxWidth(40);
doneColumn.setMinWidth(40);
textColumn.setPrefWidth(200);
textColumn.setMinWidth(100);
textColumn.setEditable(true);

代码示例来源:origin: org.jrebirth.af.showcase/todos

doneColumn.setPrefWidth(40);
doneColumn.setMaxWidth(40);
doneColumn.setMinWidth(40);
textColumn.setPrefWidth(200);
textColumn.setMinWidth(100);
textColumn.setEditable(true);

代码示例来源:origin: com.powsybl/powsybl-gse-security-analysis

equipmentColumn.setPrefWidth(200);
equipmentColumn.setCellFactory(stringColumnFactory);
equipmentColumn.setCellValueFactory(callback -> new SimpleObjectProperty<>(callback.getValue().getSubjectId()));
TableColumn<LimitViolation, String> violationTypeColumn = createColumn("ViolationType");
violationTypeColumn.setPrefWidth(150);
violationTypeColumn.setCellFactory(stringColumnFactory);
violationTypeColumn.setCellValueFactory(callback -> new SimpleObjectProperty<>(callback.getValue().getLimitType().name()));
TableColumn<LimitViolation, String> violationNameColumn = createColumn("ViolationName");
violationNameColumn.setPrefWidth(150);
violationNameColumn.setCellFactory(stringColumnFactory);
violationNameColumn.setCellValueFactory(callback -> new SimpleObjectProperty<>(callback.getValue().getLimitName()));
valueColumn.setCellValueFactory(callback -> new SimpleObjectProperty<>(callback.getValue().getValue()));
TableColumn<LimitViolation, Double> loadColumn = createColumn("Load");
loadColumn.setPrefWidth(150);
loadColumn.setCellFactory(decimalColumnFactory);
loadColumn.setCellValueFactory(callback -> {

代码示例来源:origin: com.powsybl/powsybl-gse-security-analysis

PostContingencyResultPane() {
  TableColumn<ResultRow, String> contingencyColumn = createColumn("Contingency");
  contingencyColumn.setPrefWidth(200);
  contingencyColumn.setCellFactory(stringColumnFactory);
  contingencyColumn.setCellValueFactory(callback -> callback.getValue() instanceof ContingencyRow
                           : null);
  TableColumn<ResultRow, String> equipmentColumn = createColumn("Equipment");
  equipmentColumn.setPrefWidth(200);
  equipmentColumn.setCellFactory(stringColumnFactory);
  equipmentColumn.setCellValueFactory(callback -> callback.getValue() instanceof LimitViolationRow
                          : null);
  TableColumn<ResultRow, String> violationTypeColumn = createColumn("ViolationType");
  violationTypeColumn.setPrefWidth(150);
  violationTypeColumn.setCellFactory(stringColumnFactory);
  violationTypeColumn.setCellValueFactory(callback -> callback.getValue() instanceof LimitViolationRow
                            : null);
  TableColumn<ResultRow, String> violationNameColumn = createColumn("ViolationName");
  violationNameColumn.setPrefWidth(150);
  violationNameColumn.setCellFactory(stringColumnFactory);
  violationNameColumn.setCellValueFactory(callback -> callback.getValue() instanceof LimitViolationRow
                        : null);
  TableColumn<ResultRow, Double> loadColumn = createColumn("Load");
  loadColumn.setPrefWidth(150);
  loadColumn.setCellFactory(decimalColumnFactory);
  loadColumn.setCellValueFactory(callback -> {

代码示例来源:origin: com.aquafx-project/aquafx

invitedCol.setPrefWidth(55);
invitedCol.setMaxWidth(55);
invitedCol.setCellValueFactory(new PropertyValueFactory("invited"));

相关文章