Guest User

Untitled

a guest
Jun 22nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. **@FXML
  2. private TableView<Productos> **tblViewProductos**;
  3. @FXML
  4. private TableView<Precio> **tblViewPrecio**;**
  5.  
  6. @FXML
  7. private ObservableList<Productos> listaProductos;
  8. @FXML
  9. private ObservableList<Precio> listaPrecio;
  10.  
  11. @Override
  12. public void initialize(URL location, ResourceBundle resources) {
  13. conexion = new Conexion();
  14. conexion.establecerConexion();
  15. listaProductos = FXCollections.observableArrayList();
  16. listaPrecio = FXCollections.observableArrayList();
  17. //Llenar informacion
  18. Productos.llenarInformacion(conexion.getConnection(), listaProductos);
  19. Precio.llenarInformacion(conexion.getConnection(), listaPrecio);
  20. tblViewProductos.setItems(listaProductos);
  21. tblViewPrecio.setItems(listaPrecio);
  22. //ENLAZAR COLUMMNAS Productos
  23. clmnIdProducto.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("idPro"));
  24. clmDescripcion.setCellValueFactory(new PropertyValueFactory<Productos, String>("descripcion"));
  25. clmstockMax.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("stockMax"));
  26. clmstockMin.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("stockMin"));
  27. clmCantidad.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("cantidad"));
  28. //ENLAZAR COLUMMNAS Precio
  29. clmidPrecio.setCellValueFactory(new PropertyValueFactory<Precio, Integer>("idPre"));
  30. clmfechaInicio.setCellValueFactory(new PropertyValueFactory<Precio, Date>("fechaInicio"));
  31. clmfechaFin.setCellValueFactory(new PropertyValueFactory<Precio, Date>("fechaInicio"));
  32. clmValor.setCellValueFactory(new PropertyValueFactory<Precio, Double>("valor"));
  33. clmnIdPro.setCellValueFactory(new PropertyValueFactory<Precio, Integer>("idPro"));
  34. gestionarEvento();
  35. conexion.cerrarConexion();
  36. }
Add Comment
Please, Sign In to add comment