小编Nes*_*ose的帖子

Javafx动态添加行重复数据

我在 Javafx 中有一个 Tableview,其中我尝试在用户按下按钮时动态添加一行。问题是,执行此操作时,表中以前的数据会重复。我必须说,如果我打印表中项目的大小,它会返回正确的大小,没有重复项,并且我无法选择重复的项目,也无法滚动查看它们。\n这是我的代码:\ ndetail.fxml

\n
<TableView fx:id="tblPersonalExterno" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">\n                                            <columns>\n                                                <TableColumn prefWidth="781.0000244379044">\n                                                    <graphic>\n                                                        <Label text="Externo" />\n                                                    </graphic>\n                                                    <columns>\n                                                        <TableColumn fx:id="tblcNombreExterno" prefWidth="270" text="Nombre"/>\n                                                        <TableColumn fx:id="tblcEmpresaExterno" prefWidth="270" text="Empresa" />\n                                                        <TableColumn fx:id="tblcInfPRLExterno" minWidth="0.0" prefWidth="59.0">\n                                                            <graphic>\n                                                                <Label text="Inf. PRL">\n                                                                    <tooltip>\n                                                                        <Tooltip text="Informado PRL" />\n                                                                    </tooltip>\n                                                                </Label>\n                                                            </graphic>\n                                                        </TableColumn>\n                                                        <TableColumn fx:id="tblcAprobadoPRLExterno" minWidth="0.0" prefWidth="73.00003051757812">\n                                                            <graphic>\n                                                                <Label text="Apr. Cl. PRL">\n                                                                    <tooltip>\n                                                                        <Tooltip text="Aprobado cliente PRL" />\n                                                                    </tooltip>\n                                                                </Label>\n                                                            </graphic>\n                                                        </TableColumn>\n                                                        <TableColumn fx:id="tblcFechaAprPRLExterno" prefWidth="100.0">\n                                                            <graphic>\n                                                                <Label text="Fecha apr.">\n                                                                    <tooltip>\n                                                                        <Tooltip text="Fecha de aprobaci\xc3\xb3n" />\n                                                                    </tooltip>\n                                                                </Label>\n …
Run Code Online (Sandbox Code Playgroud)

javafx tableview

1
推荐指数
1
解决办法
49
查看次数

标签 统计

javafx ×1

tableview ×1