public void actionPerformed(java.awt.event.ActionEvent e) { JButton sourceButton = (JButton) e.getSource(); int numMesa = Integer.parseInt(sourceButton.getText()); if (Conexion.mesasOcupadas.contains(Integer.toString(numMesa))) { JOptionPane.showMessageDialog( AmltpvViewClient.util.getMainFrame(), "Esta mesa esta siendo procesada en otro ordenador" + ". Por favor no haga cambios"); } try { Conexion conexion = new Conexion(ConectarJDialog.servidor); conexion.sendMsg("mesaOcupada@" + numMesa); conexion.waitForMsgs(false); } catch (UnknownHostException ex) { Logger.getLogger(ButtonHandler.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(ButtonHandler.class.getName()).log(Level.SEVERE, null, ex); } VentasDialogScreen ventasScreen = new VentasDialogScreen(AmltpvViewClient.util.getMainFrame(), true, numMesa); ventasScreen.setTitle("Mesa " + numMesa); ventasScreen.setLocationRelativeTo(AmltpvViewClient.util.getMainFrame()); ventasScreen.setVisible(true); }