Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **@FXML
- private TableView<Productos> **tblViewProductos**;
- @FXML
- private TableView<Precio> **tblViewPrecio**;**
- @FXML
- private ObservableList<Productos> listaProductos;
- @FXML
- private ObservableList<Precio> listaPrecio;
- @Override
- public void initialize(URL location, ResourceBundle resources) {
- conexion = new Conexion();
- conexion.establecerConexion();
- listaProductos = FXCollections.observableArrayList();
- listaPrecio = FXCollections.observableArrayList();
- //Llenar informacion
- Productos.llenarInformacion(conexion.getConnection(), listaProductos);
- Precio.llenarInformacion(conexion.getConnection(), listaPrecio);
- tblViewProductos.setItems(listaProductos);
- tblViewPrecio.setItems(listaPrecio);
- //ENLAZAR COLUMMNAS Productos
- clmnIdProducto.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("idPro"));
- clmDescripcion.setCellValueFactory(new PropertyValueFactory<Productos, String>("descripcion"));
- clmstockMax.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("stockMax"));
- clmstockMin.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("stockMin"));
- clmCantidad.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("cantidad"));
- //ENLAZAR COLUMMNAS Precio
- clmidPrecio.setCellValueFactory(new PropertyValueFactory<Precio, Integer>("idPre"));
- clmfechaInicio.setCellValueFactory(new PropertyValueFactory<Precio, Date>("fechaInicio"));
- clmfechaFin.setCellValueFactory(new PropertyValueFactory<Precio, Date>("fechaInicio"));
- clmValor.setCellValueFactory(new PropertyValueFactory<Precio, Double>("valor"));
- clmnIdPro.setCellValueFactory(new PropertyValueFactory<Precio, Integer>("idPro"));
- gestionarEvento();
- conexion.cerrarConexion();
- }
Add Comment
Please, Sign In to add comment