private void iniciar() {
        view.getDepManual().addActionListener(this);
        view.getRetManual().addActionListener(this);
        view.getTotalField().addActionListener(this);
        view.getVentaOk().addActionListener(this);
        tablaDetalles = view.getTablaDetDef();
        view.getTablaArticulos().addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    if (tablaDetalles.getRowCount() == 0) {
                        tablaDetalles.setRowCount(0);
                    }
                    JTable target = (JTable) e.getSource();
                    Object row[] = new Object[4];
                    row[0] = target.getValueAt(target.getSelectedRow(), 0);
                    row[1] = target.getValueAt(target.getSelectedRow(), 1);
                    row[2] = 1;
                    abrirBase();
                    Producto p = Producto.findById(target.getValueAt(target.getSelectedRow(), 0));
                    BigDecimal precio = new BigDecimal(p.getString("precio"));
                    row[3] = precio.multiply(new BigDecimal((int)row[2]));
                    if (Base.hasConnection()) {
                        Base.close();
                    }
                    tablaDetalles.addRow(row);
                    view.getVentaOk().setEnabled(true);
                    setCellEditor();
                    actualizarPrecio();
                }
            }

        });
        view.getTablaDetalles().addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    JTable t = (JTable) e.getSource();
                    tablaDetalles.removeRow(t.getSelectedRow());
                    actualizarPrecio();
                }
                if (tablaDetalles.getRowCount() == 0) {
                    view.getVentaOk().setEnabled(false);
                }

            }
        });
        view.getTablaCliente().addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                abrirBase();
                if (e.getClickCount() == 2) {
                    JTable t = (JTable) e.getSource();
                    c = Cliente.findById(t.getValueAt(t.getSelectedRow(), 0));
                    view.getClienteSel().setText(c.getString("nombre") + " " + c.getString("apellido"));
                    id_cliente = (int) t.getValueAt(t.getSelectedRow(), 0);
                }
                if (Base.hasConnection()) {
                    Base.close();
                }
            }

        });
        tablaArticulos = view.getTablaArtDef();
        tablaClientes = view.getTablaCliDef();
        tablaTrans = view.getTablaTransDef();
        proC = null;
        cliC = null;
    }