Search in sources :

Example 51 with TableView

use of javafx.scene.control.TableView in project bisq-desktop by bisq-network.

the class ArbitratorSelectionView method addArbitratorsGroup.

private void addArbitratorsGroup() {
    TableGroupHeadline tableGroupHeadline = new TableGroupHeadline(Res.get("account.arbitratorSelection.whichDoYouAccept"));
    GridPane.setRowIndex(tableGroupHeadline, ++gridRow);
    GridPane.setColumnSpan(tableGroupHeadline, 2);
    GridPane.setMargin(tableGroupHeadline, new Insets(40, -10, -10, -10));
    root.getChildren().add(tableGroupHeadline);
    tableView = new TableView<>();
    GridPane.setRowIndex(tableView, gridRow);
    GridPane.setColumnSpan(tableView, 2);
    GridPane.setMargin(tableView, new Insets(60, -10, 5, -10));
    root.getChildren().add(tableView);
    autoSelectAllMatchingCheckBox = addCheckBox(root, ++gridRow, Res.get("account.arbitratorSelection.autoSelect"));
    GridPane.setColumnSpan(autoSelectAllMatchingCheckBox, 2);
    GridPane.setHalignment(autoSelectAllMatchingCheckBox, HPos.LEFT);
    GridPane.setColumnIndex(autoSelectAllMatchingCheckBox, 0);
    GridPane.setMargin(autoSelectAllMatchingCheckBox, new Insets(0, -10, 0, -10));
    autoSelectAllMatchingCheckBox.setOnAction(event -> model.setAutoSelectArbitrators(autoSelectAllMatchingCheckBox.isSelected()));
    TableColumn<ArbitratorListItem, String> dateColumn = new AutoTooltipTableColumn<>(Res.get("account.arbitratorSelection.regDate"));
    dateColumn.setSortable(false);
    dateColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getRegistrationDate()));
    dateColumn.setMinWidth(140);
    dateColumn.setMaxWidth(140);
    TableColumn<ArbitratorListItem, String> nameColumn = new AutoTooltipTableColumn<>(Res.get("shared.onionAddress"));
    nameColumn.setSortable(false);
    nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getAddressString()));
    nameColumn.setMinWidth(90);
    TableColumn<ArbitratorListItem, String> languagesColumn = new AutoTooltipTableColumn<>(Res.get("account.arbitratorSelection.languages"));
    languagesColumn.setSortable(false);
    languagesColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getLanguageCodes()));
    languagesColumn.setMinWidth(130);
    TableColumn<ArbitratorListItem, ArbitratorListItem> selectionColumn = new AutoTooltipTableColumn<ArbitratorListItem, ArbitratorListItem>(Res.get("shared.accept")) {

        {
            setMinWidth(60);
            setMaxWidth(60);
            setSortable(false);
        }
    };
    selectionColumn.setCellValueFactory((arbitrator) -> new ReadOnlyObjectWrapper<>(arbitrator.getValue()));
    selectionColumn.setCellFactory(new Callback<TableColumn<ArbitratorListItem, ArbitratorListItem>, TableCell<ArbitratorListItem, ArbitratorListItem>>() {

        @Override
        public TableCell<ArbitratorListItem, ArbitratorListItem> call(TableColumn<ArbitratorListItem, ArbitratorListItem> column) {
            return new TableCell<ArbitratorListItem, ArbitratorListItem>() {

                private final CheckBox checkBox = new AutoTooltipCheckBox();

                private TableRow tableRow;

                private BooleanProperty selectedProperty;

                private void updateDisableState(final ArbitratorListItem item) {
                    boolean selected = model.isAcceptedArbitrator(item.arbitrator);
                    item.setIsSelected(selected);
                    boolean hasMatchingLanguage = model.hasMatchingLanguage(item.arbitrator);
                    if (!hasMatchingLanguage) {
                        model.onRemoveArbitrator(item.arbitrator);
                        if (selected)
                            item.setIsSelected(false);
                    }
                    boolean isMyOwnRegisteredArbitrator = model.isMyOwnRegisteredArbitrator(item.arbitrator);
                    checkBox.setDisable(!hasMatchingLanguage || isMyOwnRegisteredArbitrator);
                    tableRow = getTableRow();
                    if (tableRow != null) {
                        tableRow.setOpacity(hasMatchingLanguage && !isMyOwnRegisteredArbitrator ? 1 : 0.4);
                        if (isMyOwnRegisteredArbitrator) {
                            String text = Res.get("account.arbitratorSelection.cannotSelectHimself");
                            tableRow.setTooltip(new Tooltip(text));
                            tableRow.setOnMouseClicked(e -> new Popup<>().warning(text).show());
                        } else if (!hasMatchingLanguage) {
                            tableRow.setTooltip(new Tooltip(Res.get("account.arbitratorSelection.noMatchingLang")));
                            tableRow.setOnMouseClicked(e -> new Popup<>().warning(Res.get("account.arbitratorSelection.noLang")).show());
                        } else {
                            tableRow.setOnMouseClicked(null);
                            tableRow.setTooltip(null);
                        }
                    }
                }

                @Override
                public void updateItem(final ArbitratorListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        selectedProperty = item.isSelectedProperty();
                        languageCodesListChangeListener = c -> updateDisableState(item);
                        model.languageCodes.addListener(languageCodesListChangeListener);
                        isSelectedChangeListener = (observable, oldValue, newValue) -> checkBox.setSelected(newValue);
                        selectedProperty.addListener(isSelectedChangeListener);
                        checkBox.setSelected(model.isAcceptedArbitrator(item.arbitrator));
                        checkBox.setOnAction(e -> {
                            if (checkBox.isSelected()) {
                                onAddArbitrator(item);
                            } else if (model.isDeselectAllowed(item)) {
                                onRemoveArbitrator(item);
                            } else {
                                new Popup<>().warning(Res.get("account.arbitratorSelection.minOne")).show();
                                checkBox.setSelected(true);
                            }
                            item.setIsSelected(checkBox.isSelected());
                        });
                        updateDisableState(item);
                        setGraphic(checkBox);
                    } else {
                        model.languageCodes.removeListener(languageCodesListChangeListener);
                        if (selectedProperty != null)
                            selectedProperty.removeListener(isSelectedChangeListener);
                        setGraphic(null);
                        if (checkBox != null)
                            checkBox.setOnAction(null);
                        if (tableRow != null)
                            tableRow.setOnMouseClicked(null);
                    }
                }
            };
        }
    });
    // noinspection unchecked
    tableView.getColumns().addAll(dateColumn, nameColumn, languagesColumn, selectionColumn);
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
}
Also used : AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) TableGroupHeadline(bisq.desktop.components.TableGroupHeadline) Button(javafx.scene.control.Button) HPos(javafx.geometry.HPos) ListView(javafx.scene.control.ListView) ListCell(javafx.scene.control.ListCell) Layout(bisq.desktop.util.Layout) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) Inject(javax.inject.Inject) Tuple2(bisq.common.util.Tuple2) TableCell(javafx.scene.control.TableCell) FormBuilder.addLabelComboBox(bisq.desktop.util.FormBuilder.addLabelComboBox) Insets(javafx.geometry.Insets) ComboBox(javafx.scene.control.ComboBox) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) VPos(javafx.geometry.VPos) Res(bisq.core.locale.Res) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) GridPane(javafx.scene.layout.GridPane) FormBuilder.addLabelListView(bisq.desktop.util.FormBuilder.addLabelListView) Popup(bisq.desktop.main.overlays.popups.Popup) Label(javafx.scene.control.Label) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) TableRow(javafx.scene.control.TableRow) FormBuilder.addTitledGroupBg(bisq.desktop.util.FormBuilder.addTitledGroupBg) CheckBox(javafx.scene.control.CheckBox) StringConverter(javafx.util.StringConverter) FormBuilder.addCheckBox(bisq.desktop.util.FormBuilder.addCheckBox) BooleanProperty(javafx.beans.property.BooleanProperty) ImageUtil(bisq.desktop.util.ImageUtil) AnchorPane(javafx.scene.layout.AnchorPane) ImageView(javafx.scene.image.ImageView) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) LanguageUtil(bisq.core.locale.LanguageUtil) UserThread(bisq.common.UserThread) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) ChangeListener(javafx.beans.value.ChangeListener) TableGroupHeadline(bisq.desktop.components.TableGroupHeadline) Insets(javafx.geometry.Insets) BooleanProperty(javafx.beans.property.BooleanProperty) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) TableCell(javafx.scene.control.TableCell) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) CheckBox(javafx.scene.control.CheckBox) FormBuilder.addCheckBox(bisq.desktop.util.FormBuilder.addCheckBox) AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) TableRow(javafx.scene.control.TableRow) Popup(bisq.desktop.main.overlays.popups.Popup)

Example 52 with TableView

use of javafx.scene.control.TableView in project TestFX by TestFX.

the class TableViewMatchersTest method containsRow_after_edited_cell.

@Test
@Ignore("Issue #449")
public void containsRow_after_edited_cell() throws TimeoutException {
    // given:
    TableColumn<Person, String> tableColumn0 = new TableColumn<>("name");
    tableColumn0.setEditable(true);
    tableColumn0.setCellFactory(TextFieldTableCell.forTableColumn());
    tableColumn0.setCellValueFactory(new PropertyValueFactory<>("name"));
    tableColumn0.setPrefWidth(150);
    TableColumn<Person, Number> tableColumn1 = new TableColumn<>("age");
    tableColumn1.setCellValueFactory(new PropertyValueFactory<>("age"));
    tableColumn1.setEditable(true);
    TableView<Person> tableView = new TableView<>();
    tableView.setEditable(true);
    tableView.getColumns().setAll(tableColumn0, tableColumn1);
    Person alice = new Person("alice", 30);
    Person bob = new Person("bob", 41);
    tableView.setItems(observableArrayList(alice, bob));
    FxToolkit.setupSceneRoot(() -> new StackPane(tableView));
    WaitForAsyncUtils.waitForFxEvents();
    clickOn("alice");
    clickOn("alice");
    press(KeyCode.BACK_SPACE);
    write("not alice!");
    press(KeyCode.ENTER);
    // then:
    assertThat(tableView, TableViewMatchers.containsRow("not alice!", 30));
}
Also used : TableColumn(javafx.scene.control.TableColumn) StackPane(javafx.scene.layout.StackPane) TableView(javafx.scene.control.TableView) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 53 with TableView

use of javafx.scene.control.TableView in project financial by greatkendy123.

the class MyController method add2AllTeamFWF_from_tableProfit.

/**
 * 利润表修改总团队服务费(累积该团队的服务费)
 * @time 2018年1月5日
 * @param teamFWF
 */
public static void add2AllTeamFWF_from_tableProfit(TableView<ProfitInfo> table, Double teamFWF) {
    try {
        ProfitInfo profitInfo = TableUtil.getItem(table).filtered(info -> "总团队服务费".equals(info.getProfitType())).get(0);
        String allTeamFWF = NumUtil.digit0(NumUtil.getNum(profitInfo.getProfitAccount()) + teamFWF);
        profitInfo.setProfitAccount(allTeamFWF);
        table.refresh();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : Arrays(java.util.Arrays) ZijinInfo(com.kendy.entity.ZijinInfo) Huishui(com.kendy.entity.Huishui) TabPane(javafx.scene.control.TabPane) CombineIDController(com.kendy.controller.CombineIDController) QuotaController(com.kendy.controller.QuotaController) StringUtil(com.kendy.util.StringUtil) Map(java.util.Map) KaixiaoInfo(com.kendy.entity.KaixiaoInfo) DatePicker(javafx.scene.control.DatePicker) TeamHuishuiInfo(com.kendy.entity.TeamHuishuiInfo) Pair(javafx.util.Pair) PropertyValueFactory(javafx.scene.control.cell.PropertyValueFactory) TotalInfo(com.kendy.entity.TotalInfo) JiaoshouInfo(com.kendy.entity.JiaoshouInfo) Set(java.util.Set) MemberService(com.kendy.service.MemberService) MemberZJInfo(com.kendy.entity.MemberZJInfo) KeyEvent(javafx.scene.input.KeyEvent) Platform(javafx.application.Platform) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) ShangmaInfo(com.kendy.entity.ShangmaInfo) UserInfos(com.kendy.entity.UserInfos) TypeReference(com.alibaba.fastjson.TypeReference) CollectUtil(com.kendy.util.CollectUtil) ShowUtil(com.kendy.util.ShowUtil) RadioButton(javafx.scene.control.RadioButton) TextInputDialog(javafx.scene.control.TextInputDialog) ConsUtil(com.kendy.util.ConsUtil) ObservableList(javafx.collections.ObservableList) ErrorUtil(com.kendy.util.ErrorUtil) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) Hyperlink(javafx.scene.control.Hyperlink) ButtonData(javafx.scene.control.ButtonBar.ButtonData) MouseButton(javafx.scene.input.MouseButton) SimpleDateFormat(java.text.SimpleDateFormat) FXCollections(javafx.collections.FXCollections) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) ResourceBundle(java.util.ResourceBundle) WaizhaiInfo(com.kendy.entity.WaizhaiInfo) ShangmaService(com.kendy.service.ShangmaService) FXMLLoader(javafx.fxml.FXMLLoader) GridPane(javafx.scene.layout.GridPane) JifenInfo(com.kendy.entity.JifenInfo) Color(javafx.scene.paint.Color) DBConnection(com.kendy.db.DBConnection) Node(javafx.scene.Node) CheckBox(javafx.scene.control.CheckBox) IOException(java.io.IOException) File(java.io.File) ProfitInfo(com.kendy.entity.ProfitInfo) FileChooser(javafx.stage.FileChooser) JSON(com.alibaba.fastjson.JSON) DangtianHuizongInfo(com.kendy.entity.DangtianHuizongInfo) Tab(javafx.scene.control.Tab) ObservableValue(javafx.beans.value.ObservableValue) Entity(com.kendy.interfaces.Entity) RandomUtil(com.kendy.util.RandomUtil) EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) Initializable(javafx.fxml.Initializable) NumUtil(com.kendy.util.NumUtil) URL(java.net.URL) InputDialog(com.kendy.util.InputDialog) VBox(javafx.scene.layout.VBox) DangjuInfo(com.kendy.entity.DangjuInfo) Logger(org.apache.log4j.Logger) Parent(javafx.scene.Parent) WaizhaiService(com.kendy.service.WaizhaiService) AlertType(javafx.scene.control.Alert.AlertType) ComboBox(javafx.scene.control.ComboBox) MoneyService(com.kendy.service.MoneyService) WindowEvent(javafx.stage.WindowEvent) ProxySumInfo(com.kendy.entity.ProxySumInfo) TableView(javafx.scene.control.TableView) PingzhangInfo(com.kendy.entity.PingzhangInfo) Alert(javafx.scene.control.Alert) HBox(javafx.scene.layout.HBox) TextField(javafx.scene.control.TextField) Image(java.awt.Image) BufferedImage(java.awt.image.BufferedImage) CellEditEvent(javafx.scene.control.TableColumn.CellEditEvent) Font(javafx.scene.text.Font) ExcelReaderUtil(com.kendy.excel.ExcelReaderUtil) LMController(com.kendy.controller.LMController) FXML(javafx.fxml.FXML) List(java.util.List) ZonghuiInfo(com.kendy.entity.ZonghuiInfo) ProxyTeamInfo(com.kendy.entity.ProxyTeamInfo) Optional(java.util.Optional) Toggle(javafx.scene.control.Toggle) Queue(java.util.Queue) Scene(javafx.scene.Scene) ListView(javafx.scene.control.ListView) TextArea(javafx.scene.control.TextArea) ButtonType(javafx.scene.control.ButtonType) MouseEvent(javafx.scene.input.MouseEvent) HistoryRecord(com.kendy.entity.HistoryRecord) GDController(com.kendy.controller.GDController) HashMap(java.util.HashMap) TextFieldTableCell(javafx.scene.control.cell.TextFieldTableCell) TableColumn(javafx.scene.control.TableColumn) HashSet(java.util.HashSet) TableCell(javafx.scene.control.TableCell) Insets(javafx.geometry.Insets) ShangmaDetailInfo(com.kendy.entity.ShangmaDetailInfo) ZonghuiKaixiaoInfo(com.kendy.entity.ZonghuiKaixiaoInfo) TableUtil(com.kendy.util.TableUtil) LinkedList(java.util.LinkedList) TeamInfo(com.kendy.entity.TeamInfo) Callback(javafx.util.Callback) DBUtil(com.kendy.db.DBUtil) Player(com.kendy.entity.Player) ZonghuiService(com.kendy.service.ZonghuiService) KeyCode(javafx.scene.input.KeyCode) Dialog(javafx.scene.control.Dialog) Label(javafx.scene.control.Label) Iterator(java.util.Iterator) SMAutoController(com.kendy.controller.SMAutoController) TableRow(javafx.scene.control.TableRow) Wrap(com.kendy.other.Wrap) TGController(com.kendy.controller.TGController) TeamProxyService(com.kendy.service.TeamProxyService) Text2ImageUtil(com.kendy.util.Text2ImageUtil) ActionEvent(javafx.event.ActionEvent) ToggleGroup(javafx.scene.control.ToggleGroup) Stage(javafx.stage.Stage) WanjiaInfo(com.kendy.entity.WanjiaInfo) JifenService(com.kendy.service.JifenService) ChangeListener(javafx.beans.value.ChangeListener) ClipBoardUtil(com.kendy.util.ClipBoardUtil) IOException(java.io.IOException) ProfitInfo(com.kendy.entity.ProfitInfo)

Example 54 with TableView

use of javafx.scene.control.TableView in project financial by greatkendy123.

the class TGExportExcelService method getTGWaizhaiExcelModel.

/**
 * 导出托管公司的团队外债与团队外债明细
 * @return
 */
private TGExcelModel getTGWaizhaiExcelModel() {
    TGExcelModel excelModel = new TGExcelModel();
    List<String> titleList = new LinkedList<>();
    List<Object[]> data = new LinkedList<>();
    List<String> titleSumList = new LinkedList<>();
    List<Object[]> dataSum = new LinkedList<>();
    // 取值
    // 传给Excel的外债数据
    Map<String, List<Object[]>> teamMap = new LinkedHashMap<>();
    ObservableList<Node> items = tgController.tgWZTeamHBox.getChildren();
    // 存放总和表
    ObservableList<TypeValueInfo> sumItems = tgController.tgWZTeam.getItems();
    if (CollectUtil.isHaveValue(sumItems)) {
        List<Object[]> teamList = tgController.tgWZTeam.getItems().stream().map(info -> {
            Object[] obj = new Object[2];
            obj[0] = info.getType();
            obj[1] = info.getValue();
            return obj;
        }).collect(Collectors.toList());
        String key = tgController.tgWZTeam.getColumns().get(0).getText() + "#" + tgController.tgWZTeam.getColumns().get(1).getText();
        teamMap.put(key, teamList);
    }
    // 存放明细表
    if (CollectUtil.isHaveValue(items)) {
        for (Node node : items) {
            TableView<CurrentMoneyInfo> table = (TableView<CurrentMoneyInfo>) node;
            List<Object[]> teamList = table.getItems().stream().map(info -> {
                Object[] obj = new Object[2];
                obj[0] = info.getMingzi();
                obj[1] = info.getShishiJine();
                return obj;
            }).collect(Collectors.toList());
            String key = table.getColumns().get(0).getText() + "#" + table.getColumns().get(1).getText();
            teamMap.put(key, teamList);
        }
    }
    excelModel.setColumnList(titleList);
    excelModel.setData(data);
    excelModel.setColumnSumList(titleSumList);
    excelModel.setDataSum(dataSum);
    excelModel.setSheetName("外债");
    // 设值
    excelModel.setWaiZai(true);
    excelModel.setWaizhaiMap(teamMap);
    return excelModel;
}
Also used : Button(javafx.scene.control.Button) Arrays(java.util.Arrays) TGCommentInfo(com.kendy.entity.TGCommentInfo) HashMap(java.util.HashMap) ExportTGExcel(com.kendy.excel.ExportTGExcel) TypeValueInfo(com.kendy.entity.TypeValueInfo) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) StringUtil(com.kendy.util.StringUtil) Map(java.util.Map) LinkedList(java.util.LinkedList) TGLirunInfo(com.kendy.entity.TGLirunInfo) TableView(javafx.scene.control.TableView) TGFwfinfo(com.kendy.entity.TGFwfinfo) TextField(javafx.scene.control.TextField) Label(javafx.scene.control.Label) TGTeamInfo(com.kendy.entity.TGTeamInfo) Node(javafx.scene.Node) TGController(com.kendy.controller.TGController) Collectors(java.util.stream.Collectors) TGExcelModel(com.kendy.entity.TGExcelModel) FXML(javafx.fxml.FXML) List(java.util.List) CollectUtil(com.kendy.util.CollectUtil) ShowUtil(com.kendy.util.ShowUtil) TGKaixiaoInfo(com.kendy.entity.TGKaixiaoInfo) ObservableList(javafx.collections.ObservableList) ErrorUtil(com.kendy.util.ErrorUtil) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) TypeValueInfo(com.kendy.entity.TypeValueInfo) Node(javafx.scene.Node) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap) TGExcelModel(com.kendy.entity.TGExcelModel) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) ObservableList(javafx.collections.ObservableList) TableView(javafx.scene.control.TableView)

Example 55 with TableView

use of javafx.scene.control.TableView in project MiscellaneousStudy by mikoto2000.

the class TableViewSample method start.

@Override
public void start(Stage stage) {
    // TableView にルート要素を指定しながらインスタンス化
    TableView<TableData> tableView = new TableView<>();
    // 列の定義
    TableColumn<TableData, String> firstNameCol = new TableColumn<>("First Name");
    firstNameCol.setCellValueFactory(new PropertyValueFactory<>("firstName"));
    TableColumn<TableData, String> lastNameCol = new TableColumn<>("Last Name");
    lastNameCol.setCellValueFactory(new PropertyValueFactory<>("lastName"));
    ObservableList<TableColumn<TableData, ?>> columns = tableView.getColumns();
    columns.add(firstNameCol);
    columns.add(lastNameCol);
    // テーブルレコードの作成
    ObservableList<TableData> tableDatas = FXCollections.observableArrayList();
    TableData tableData01 = new TableData("First", "Last");
    tableDatas.add(tableData01);
    TableData tableData02 = new TableData("Fukuzo", "Moguro");
    tableDatas.add(tableData02);
    TableData tableData03 = new TableData("Mikoto", "Ohyuki");
    tableDatas.add(tableData03);
    tableView.setItems(tableDatas);
    // シーン作成
    Scene scene = new Scene(tableView);
    stage.setScene(scene);
    stage.setTitle("Table View Sample");
    stage.show();
}
Also used : Scene(javafx.scene.Scene) TableColumn(javafx.scene.control.TableColumn) TableView(javafx.scene.control.TableView)

Aggregations

TableView (javafx.scene.control.TableView)70 TableColumn (javafx.scene.control.TableColumn)60 Map (java.util.Map)40 List (java.util.List)39 ArrayList (java.util.ArrayList)38 Button (javafx.scene.control.Button)38 Label (javafx.scene.control.Label)38 FXCollections (javafx.collections.FXCollections)37 Insets (javafx.geometry.Insets)36 Collectors (java.util.stream.Collectors)33 Scene (javafx.scene.Scene)33 Tab (javafx.scene.control.Tab)33 BorderPane (javafx.scene.layout.BorderPane)32 Optional (java.util.Optional)31 ObservableValue (javafx.beans.value.ObservableValue)30 VBox (javafx.scene.layout.VBox)29 Collections (java.util.Collections)28 MenuItem (javafx.scene.control.MenuItem)28 HashMap (java.util.HashMap)27 Set (java.util.Set)27