Filtro CPL Polarizado ventajas

Sistema Bancario con Cliente Servidor RPC en JAVA y MYSQL

Sistema Bancario con RPC en JAVA ( RPC JAVA Sistema Bancario y Base de Datos)
Cliente y Servidor RPC y Base de Datos MYSQL

Les comparto un pequeño sistema bancario hecho en JAVA con comunicación RPC


El Servidor RPC


Su estructura en NetBeans:
El archivo
Conexion.java

package Conexion_BD;

import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.text.BadLocationException;
import sistemabancario.rpc.rmi_MAIN.Main_Principal;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class Conexion {
       Connection con = null;        
    public Connection conex () throws BadLocationException{
        try{
        Class.forName("com.mysql.jdbc.Driver");
        con= DriverManager.getConnection("jdbc:mysql://localhost/bankito","root","chkdskshrasd");
            Main_Principal.Write("[Servidor BD] Conexion establecida");
        }catch(Exception e){
            Main_Principal.Write("[Servidor BD] NO se pudo iniciar la Base de Datos");
        }
        return con;
    }
}
El archivo ServerObject_RPC.java

package Servers_RMI_RPC;

import Conexion_BD.Conexion;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.text.BadLocationException;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class ServerObject_RPC{

    Conexion C = new Conexion();
    Connection CC;
    PreparedStatement us;
    int acceso = 0;
    public String cliente = "";
    int saldo = 0;

    Vector datos = new Vector();
    Vector> estado = new Vector>();
    
    Vector saldoA = new Vector();
    Vector retiro = new Vector();
    Vector fecha = new Vector();
    Vector claveC = new Vector();
    
    public ServerObject_RPC() throws BadLocationException {
        this.CC = C.conex();
    }

    public int acceso(int usuario, int clave) {
        acceso = 0;
        try {
            Statement st = CC.createStatement();
            ResultSet rs = st.executeQuery("SELECT * FROM usuario;");
            while (rs.next()) {
                if (rs.getInt(4) == usuario && rs.getInt(2) == clave) {
                    acceso = 1;
                }
            }
            rs.close();
        } catch (SQLException ex) {
            acceso = 0;
        }
        return acceso;
    }

    public String cliente(int usuario) {
        try {
            Statement st = CC.createStatement();
            ResultSet rs = st.executeQuery("SELECT * FROM cliente;");
            while (rs.next()) {

                if (rs.getInt(1) == usuario) {
                    cliente = rs.getString("numeroCuentaCliente");
                }
            }
            rs.close();
        } catch (SQLException ex) {
            acceso = 0;
        }
        return cliente;
    }

    public int saldo(int usuario) {
        try {
            Statement st = CC.createStatement();
            ResultSet rs = st.executeQuery("SELECT * FROM saldo;");
            while (rs.next()) {
                if (rs.getInt(4) == usuario) {
                    saldo = rs.getInt("saldo");
                }
            }
            rs.close();
        } catch (SQLException ex) {
            acceso = 0;
        }
        return saldo;
    }

    public int insertar_estado(String Sa,String r,String f,String idca,String idcl) {
        acceso = 0;
        int s = Integer.parseInt(Sa);
        int ret = Integer.parseInt(r);
        try {
            us = CC.prepareStatement("INSERT INTO estado(saldoAnterior"
                    + ",retiro,fecha,claveCajero, cliente_idCliente) VALUES('"
                    + s + "'," + ret + ",'"+f+"','" + idca + "',"+idcl+")");
            us.executeUpdate();
            acceso = 1;
        } catch (SQLException ex) {
             System.out.println(""+ex.getMessage());
        }
        return acceso;
    }
    
    public int insertar_nSaldo(String saldo,String fecha,String usuario){
        acceso = 0;
        int s = Integer.parseInt(saldo);
        int u = Integer.parseInt(usuario);
        try {
            us = CC.prepareStatement("INSERT INTO saldo(saldo"
                    + ",fecha,usuario_idUsuario) VALUES("
                    + s + ",'" + fecha +"',"+u+")");
            us.executeUpdate();
            acceso = 1;
        } catch (SQLException ex) {
             System.out.println(""+ex.getMessage());
        }
        return acceso;
    }
    
    public Vector> estado(int cliente){
        try {
            String consulta = "SELECT saldoAnterior,retiro,fecha,claveCajero FROM estado WHERE cliente_idCliente="+cliente;
            Statement st = CC.createStatement();
            ResultSet rs = st.executeQuery(consulta);
            while (rs.next()) {
                saldoA.addElement(rs.getString("saldoAnterior"));
                retiro.addElement(rs.getString("retiro"));
                fecha.addElement(rs.getString("fecha"));
                claveC.addElement(rs.getString("claveCajero"));
            }
            estado.addElement(saldoA);
            estado.addElement(retiro);
            estado.addElement(fecha);
            estado.addElement(claveC);

            
        } catch (Exception e) {

        }
        return estado;
    }       
    
}

El Main_Principal.java
package sistemabancario.rpc.rmi_MAIN;

import Servers_RMI_RPC.ServerObject_RPC;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
import org.apache.xmlrpc.WebServer;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class Main_Principal extends javax.swing.JFrame {
    int i =0, j = 0;
    public Main_Principal() {
        initComponents();
        this.setTitle("Panel de Control");
        this.setLocationRelativeTo(this);
        
    }

    @SuppressWarnings("unchecked")
    //                           
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        runRPC = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jLabel1 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        salirmenu = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jPanel1.setBackground(new java.awt.Color(153, 255, 153));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Iniciar/Terminar RPC"));

        runRPC.setBackground(new java.awt.Color(51, 255, 204));
        runRPC.setText("Iniciar RPC");
        runRPC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                runRPCActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(125, 125, 125)
                .addComponent(runRPC, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(runRPC)
        );

        jPanel2.setBackground(new java.awt.Color(255, 153, 51));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Mensajes de estado"));

        jScrollPane1.setBackground(new java.awt.Color(0, 0, 0));

        area_mensajes.setEditable(false);
        area_mensajes.setForeground(new java.awt.Color(255, 0, 0));
        area_mensajes.setCaretColor(new java.awt.Color(0, 0, 0));
        jScrollPane1.setViewportView(area_mensajes);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
        );

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/logo.png"))); // NOI18N

        jMenu1.setText("Opciones");

        salirmenu.setText("Salir");
        salirmenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salirmenuActionPerformed(evt);
            }
        });
        jMenu1.add(salirmenu);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }//                         

    private void salirmenuActionPerformed(java.awt.event.ActionEvent evt) {                                          
        System.exit(0);
    }                                         

    public static void Write(String msg) throws BadLocationException {        
        SimpleAttributeSet attrs = new SimpleAttributeSet();
        Main_Principal.area_mensajes.getStyledDocument().insertString(Main_Principal.area_mensajes.getStyledDocument().getLength() + 1, " █>>"+msg, attrs);
    }
    
    public void iniciar_RPC() throws BadLocationException {
        WebServer serverRPC = new WebServer(81);
        ServerObject_RPC op = new ServerObject_RPC();
        try {
            if(i == 0){
            serverRPC.addHandler("ServerRPC", op);
            serverRPC.start();
            Write("RPC ejectandose correctamente");
            runRPC.setText("Terminar RPC");
            i = 1;
            }else{
                serverRPC.shutdown();
                i = 0;
                runRPC.setText("Iniciar RPC");
                Write("RPC termino correctamente");
            }
        } catch (Exception e) {
            Write("[RPC]:" + e.getMessage());
        }

    }

    private void runRPCActionPerformed(java.awt.event.ActionEvent evt) {                                       
        try {
            iniciar_RPC();
        } catch (BadLocationException ex) {
            try {
                Write("Error al iniciar RPC");
            } catch (BadLocationException ex1) {
                
            }
        }
    }                                      

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Main_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Main_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Main_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Main_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Main_Principal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    public static final javax.swing.JTextPane area_mensajes = new javax.swing.JTextPane();
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton runRPC;
    private javax.swing.JMenuItem salirmenu;
    // End of variables declaration                   
}

El Cliente RPC


 

El Principal.java


package cliente_banco;

import java.util.Vector;
import org.apache.xmlrpc.XmlRpcClient;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class Principal extends javax.swing.JFrame {

    String ruta_RPC = "http://localhost:81/";
    Vector datos = new Vector();
    Vector datos2 = new Vector();
    int acceso = 0;
    String client = "";
    

    public Principal() {
        initComponents();
        setSize(555, 435);
        setLocationRelativeTo(this);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    //                           
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        usuario = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        error = new javax.swing.JLabel();
        aceptar = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        pass = new javax.swing.JPasswordField();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        mensaje = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/logo.png"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 547, 112);

        usuario.setFont(new java.awt.Font("Dialog", 0, 24)); // NOI18N
        getContentPane().add(usuario);
        usuario.setBounds(170, 150, 230, 50);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/clave.png"))); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(160, 130, 250, 90);

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cinta.png"))); // NOI18N
        getContentPane().add(jLabel3);
        jLabel3.setBounds(0, 380, 547, 28);

        jLabel4.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        jLabel4.setText("Contraseña:");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(30, 240, 120, 25);

        error.setBackground(new java.awt.Color(255, 255, 255));
        error.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        error.setForeground(new java.awt.Color(255, 0, 0));
        getContentPane().add(error);
        error.setBounds(20, 350, 520, 0);

        aceptar.setBackground(new java.awt.Color(102, 255, 102));
        aceptar.setFont(new java.awt.Font("Century Gothic", 1, 24)); // NOI18N
        aceptar.setText("ACEPTAR");
        aceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarActionPerformed(evt);
            }
        });
        getContentPane().add(aceptar);
        aceptar.setBounds(190, 300, 170, 50);

        jLabel6.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        jLabel6.setText("B I E N V E N I D O");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(180, 110, 210, 25);

        pass.setFont(new java.awt.Font("Dialog", 0, 24)); // NOI18N
        getContentPane().add(pass);
        pass.setBounds(170, 230, 230, 50);

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/clave.png"))); // NOI18N
        getContentPane().add(jLabel5);
        jLabel5.setBounds(160, 210, 250, 90);

        jLabel7.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        jLabel7.setText("Usuario:");
        getContentPane().add(jLabel7);
        jLabel7.setBounds(60, 170, 90, 25);

        mensaje.setForeground(new java.awt.Color(255, 0, 0));
        getContentPane().add(mensaje);
        mensaje.setBounds(30, 360, 490, 20);

        pack();
    }//                         

    private void aceptarActionPerformed(java.awt.event.ActionEvent evt) {                                        
        if (usuario.getText().isEmpty() && pass.getText().isEmpty()) {
            mensaje.setText("Llene los campos");
        } else {
            String user = usuario.getText();
            String pas = pass.getText().toString();
            datos.addElement(Integer.parseInt(user));
            datos.addElement(Integer.parseInt(pas));
            try {
                XmlRpcClient cliente= new XmlRpcClient(ruta_RPC);
                Object result = cliente.execute("ServerRPC.acceso", datos);

                acceso = (Integer) result;
                mensaje.setText("Entrando...");
                
                if (acceso == 1) {
                    recupera_cuenta(Integer.parseInt(user));
                } else {
                    mensaje.setText("Error de credenciales");
                }
            } catch (Exception e) {
            }

            usuario.setText("");
            pass.setText("");
        }
        datos.clear();
    }                                       

    public void recupera_cuenta(int user) {
        datos2.addElement(user);
        try {
            XmlRpcClient cliente = new XmlRpcClient(ruta_RPC);
            Object result = cliente.execute("ServerRPC.cliente", datos2);
            client = (String) result;
            this.setVisible(false);
            Principal2 on = new Principal2(client,user);
            on.setVisible(true);
        } catch (Exception e) {
            mensaje.setText(""+e.getMessage());
        }
        datos2.clear();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton aceptar;
    private javax.swing.JLabel error;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel mensaje;
    private javax.swing.JPasswordField pass;
    private javax.swing.JTextField usuario;
    // End of variables declaration                   
}

El Principan2.java



package cliente_banco;

import java.util.Vector;
import org.apache.xmlrpc.XmlRpcClient;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class Principal2 extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    String ruta_RPC = "http://localhost:81/";
    Vector datos = new Vector();
    Vector datos2 = new Vector();
    Vector> estado = new Vector>();
    String client = "";
    int saldo = 0;
    int user = 0;

    public Principal2(String cliente, int user) {
        initComponents();
        setSize(555, 435);
        client = cliente;
        this.user = user;
        mensaje.setText("CLIENTE: " + cliente);
        setLocationRelativeTo(this);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    //                           
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        consultaSaldo = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        salir2 = new javax.swing.JButton();
        cambios = new javax.swing.JButton();
        error = new javax.swing.JLabel();
        mensaje = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/logo.png"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 547, 112);

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cinta.png"))); // NOI18N
        getContentPane().add(jLabel3);
        jLabel3.setBounds(0, 380, 547, 28);

        consultaSaldo.setBackground(new java.awt.Color(0, 204, 204));
        consultaSaldo.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        consultaSaldo.setText("C O N S U L T A R   S A L D O");
        consultaSaldo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consultaSaldoActionPerformed(evt);
            }
        });
        getContentPane().add(consultaSaldo);
        consultaSaldo.setBounds(280, 120, 250, 90);

        jButton6.setBackground(new java.awt.Color(0, 204, 204));
        jButton6.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        jButton6.setText("R E T I R A R   E F E C T I V O");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton6);
        jButton6.setBounds(20, 120, 250, 90);

        salir2.setBackground(new java.awt.Color(255, 0, 0));
        salir2.setFont(new java.awt.Font("Century Gothic", 1, 24)); // NOI18N
        salir2.setForeground(new java.awt.Color(255, 255, 255));
        salir2.setText("S A L I R");
        salir2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salir2ActionPerformed(evt);
            }
        });
        getContentPane().add(salir2);
        salir2.setBounds(280, 230, 250, 90);

        cambios.setBackground(new java.awt.Color(0, 204, 204));
        cambios.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        cambios.setText("V E R   U L T I M O S   C A M B I O S ");
        cambios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cambiosActionPerformed(evt);
            }
        });
        getContentPane().add(cambios);
        cambios.setBounds(20, 230, 250, 90);

        error.setForeground(new java.awt.Color(255, 0, 0));
        getContentPane().add(error);
        error.setBounds(20, 330, 500, 16);

        mensaje.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        mensaje.setForeground(new java.awt.Color(0, 0, 0));
        mensaje.setText("U S U A R I O: ");
        getContentPane().add(mensaje);
        mensaje.setBounds(20, 360, 180, 19);

        pack();
    }//                         

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        this.setVisible(false);
        retirar on = new retirar(client, user);
        on.setVisible(true);
    }                                        

    private void salir2ActionPerformed(java.awt.event.ActionEvent evt) {                                       
        this.setVisible(false);
        Principal on = new Principal();
        on.setVisible(true);
    }                                      

    private void consultaSaldoActionPerformed(java.awt.event.ActionEvent evt) {                                              
        int ss = saldo();
        this.setVisible(false);
        String s = String.valueOf(ss);
        saldo on = new saldo(s, client, user);
        on.setVisible(true);
    }                                             

    public int saldo() {
        System.out.println("lol");
        datos.addElement(user);
        try {
            XmlRpcClient cliente = new XmlRpcClient(ruta_RPC);
            Object result = cliente.execute("ServerRPC.saldo", datos);
            saldo = (int) result;
            System.out.println(saldo);
        } catch (Exception e) {
            error.setText("" + e.getMessage());
        }
        datos.clear();
        return saldo;
    }

    private void cambiosActionPerformed(java.awt.event.ActionEvent evt) {                                        

        datos2.addElement(user);
        try {
            XmlRpcClient cliente = new XmlRpcClient(ruta_RPC);
            Object result = cliente.execute("ServerRPC.estado", datos2);
            estado = (Vector>) result;
            System.out.println(saldo);
            if (!estado.isEmpty()) {
                this.setVisible(false);
                ultimosCambios on = new ultimosCambios(estado,client,user);
                on.visualizar();
            }else{
                error.setText("No se encontraron datos");
            }

        } catch (Exception e) {
            error.setText("" + e.getMessage());
        }

    }                                       

    public String return_cliente() {
        return client;
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //
        //
/* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { //new Principal2(0).setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton cambios; private javax.swing.JButton consultaSaldo; private javax.swing.JLabel error; private javax.swing.JButton jButton6; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel mensaje; private javax.swing.JButton salir2; // End of variables declaration }


 El retirar.java



package cliente_banco;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Vector;
import javax.swing.JOptionPane;
import org.apache.xmlrpc.XmlRpcClient;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class retirar extends javax.swing.JFrame {

    static String CAJERO = "4GJB";
    static String ruta_RPC = "http://localhost:81/";
    String cliente = "";
    int user = 0;
    String time = "";
    int year, mes,dia,hora, min, seg;
    Calendar calendario = new GregorianCalendar();
    Vector datos = new Vector();
    Vector datoss = new Vector();
    int sal = 0;
    Principal2 ob = new Principal2(cliente, user);

    public retirar(String cliente, int user) {
        initComponents();
        setSize(555, 435);
        this.cliente = cliente;
        this.user = user;
        mensaje.setText("CLIENTE:" + this.cliente);
        setLocationRelativeTo(this);
    }

    public String obtener_hora() {
        year = calendario.get(Calendar.YEAR);
        mes = calendario.get(Calendar.MONTH);
        dia = calendario.get(Calendar.DAY_OF_MONTH);
        hora = calendario.get(Calendar.HOUR_OF_DAY);
        min = calendario.get(Calendar.MINUTE);
        seg = calendario.get(Calendar.SECOND);
        return year+"-"+mes+"-"+dia+"-"+hora + ":" + min + ":" + seg;
    }

    public void retirar(int monto) {
        wr("uno");
        int s = ob.saldo();
        wr(""+monto+"-"+s);
        datos.addElement("" + s);
        datos.addElement("" + monto);
        datos.addElement(obtener_hora());
        datos.addElement(CAJERO);
        datos.addElement("" + user);
        wr("dos");
        if (monto <= s) {
            sal = s - monto;
            datoss.addElement(String.valueOf(sal));
            datoss.addElement("" + obtener_hora());
            datoss.addElement("" + user);
            try {
                wr("tres");
                XmlRpcClient clientee = new XmlRpcClient(ruta_RPC);
                Object result = clientee.execute("ServerRPC.insertar_estado", datos);
                Object resultt = clientee.execute("ServerRPC.insertar_nSaldo", datoss);
                int rr = (int) result;
                int r = (int) resultt;
                wr("cuatro");
                if (r == 1 && rr == 1) {
                    JOptionPane.showMessageDialog(null, "RETIRE SU EFECTIVO");
                    this.setVisible(false);
                    Principal on = new Principal();
                    on.setVisible(true);
                }
            } catch (Exception e) {
            }
        } else {
            error.setText("NO CUENTA CON EL SALDO SUFICIENTE");
        }

        datos.clear();
        datoss.clear();
    }

    @SuppressWarnings("unchecked")
    //                           
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        cancelar = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        mensaje = new javax.swing.JLabel();
        jButton7 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        error = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/logo.png"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 547, 112);

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cinta.png"))); // NOI18N
        getContentPane().add(jLabel3);
        jLabel3.setBounds(0, 380, 547, 28);

        jButton4.setBackground(new java.awt.Color(0, 204, 204));
        jButton4.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        jButton4.setText("$ 5,000");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton4);
        jButton4.setBounds(280, 190, 210, 60);

        jButton6.setBackground(new java.awt.Color(0, 204, 204));
        jButton6.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        jButton6.setText("$ 100");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton6);
        jButton6.setBounds(20, 190, 210, 60);

        cancelar.setBackground(new java.awt.Color(255, 0, 0));
        cancelar.setFont(new java.awt.Font("Century Gothic", 1, 24)); // NOI18N
        cancelar.setForeground(new java.awt.Color(255, 255, 255));
        cancelar.setText("C A N C E L A R");
        cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelarActionPerformed(evt);
            }
        });
        getContentPane().add(cancelar);
        cancelar.setBounds(280, 260, 210, 60);

        jButton8.setBackground(new java.awt.Color(0, 204, 204));
        jButton8.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        jButton8.setText("$ 500");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton8);
        jButton8.setBounds(20, 260, 210, 60);

        mensaje.setText("U S U A R I O: ");
        getContentPane().add(mensaje);
        mensaje.setBounds(30, 340, 180, 16);

        jButton7.setBackground(new java.awt.Color(0, 204, 204));
        jButton7.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        jButton7.setText("$ 50");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton7);
        jButton7.setBounds(20, 120, 210, 60);

        jButton5.setBackground(new java.awt.Color(0, 204, 204));
        jButton5.setFont(new java.awt.Font("Century Gothic", 1, 12)); // NOI18N
        jButton5.setText("$ 1,000");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton5);
        jButton5.setBounds(280, 120, 210, 60);
        getContentPane().add(error);
        error.setBounds(30, 360, 450, 0);

        pack();
    }//                         

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        retirar(100);
    }                                        

    private void cancelarActionPerformed(java.awt.event.ActionEvent evt) {                                         
        this.setVisible(false);
        Principal2 on = new Principal2(cliente, user);
        on.setVisible(true);
    }                                        

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        retirar(5000);
    }                                        

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        retirar(50);
    }                                        

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        retirar(1000);
    }                                        

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        retirar(500);
    }                                        
    
    public void wr(String ms){
        System.out.println(ms);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(retirar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(retirar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(retirar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(retirar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //
        //
// // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { } }); } // Variables declaration - do not modify private javax.swing.JButton cancelar; private javax.swing.JLabel error; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JButton jButton8; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel mensaje; // End of variables declaration }

 El saldo.java



package cliente_banco;


/**
 *
 * @author Ivan Luis Jimenez
 */
public class saldo extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    
    String cliente = "";
    int user = 0;
    public saldo(String saldo,String cliente,int user) {
        initComponents();
        setSize(555, 435);
        this.cliente = cliente;
        this.user = user;
        mensaje.setText("USUARIO:"+this.cliente);
        this.saldo.setText("$"+saldo);
        setLocationRelativeTo(this);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    //                           
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        saldo = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        error = new javax.swing.JLabel();
        aceptar = new javax.swing.JButton();
        mensaje = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/logo.png"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 547, 112);

        saldo.setFont(new java.awt.Font("Century Gothic", 1, 36)); // NOI18N
        saldo.setForeground(new java.awt.Color(255, 0, 0));
        saldo.setText("2588");
        getContentPane().add(saldo);
        saldo.setBounds(180, 220, 220, 40);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/saldo.png"))); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(160, 190, 250, 90);

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cinta.png"))); // NOI18N
        getContentPane().add(jLabel3);
        jLabel3.setBounds(0, 380, 547, 28);

        jLabel4.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        jLabel4.setText("S U  S A L D O  E S:");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(180, 160, 250, 25);

        error.setBackground(new java.awt.Color(255, 255, 255));
        error.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        error.setForeground(new java.awt.Color(255, 0, 0));
        getContentPane().add(error);
        error.setBounds(20, 350, 520, 0);

        aceptar.setBackground(new java.awt.Color(102, 255, 102));
        aceptar.setFont(new java.awt.Font("Century Gothic", 1, 24)); // NOI18N
        aceptar.setText("ACEPTAR");
        aceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarActionPerformed(evt);
            }
        });
        getContentPane().add(aceptar);
        aceptar.setBounds(200, 290, 170, 50);

        mensaje.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        mensaje.setForeground(new java.awt.Color(0, 0, 0));
        getContentPane().add(mensaje);
        mensaje.setBounds(20, 350, 270, 20);

        pack();
    }//                         

    private void aceptarActionPerformed(java.awt.event.ActionEvent evt) {                                        
       
        this.setVisible(false);
        Principal2 on = new Principal2(cliente,user);
        on.setVisible(true);
    }                                       

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(saldo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(saldo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(saldo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(saldo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //
        //
/* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { } }); } // Variables declaration - do not modify private javax.swing.JButton aceptar; private javax.swing.JLabel error; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel mensaje; private javax.swing.JLabel saldo; // End of variables declaration }

 El ultimosCambios.java



package cliente_banco;

import java.util.Vector;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Ivan Luis Jimenez
 */
public class ultimosCambios extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    Vector sA = new Vector();
    Vector re = new Vector();
    Vector fe = new Vector();
    Vector cC = new Vector();
    
    int user = 0;
    String cliente = "";
    public ultimosCambios(Vector> estado,String client,int user) {
        initComponents();
        setSize(555, 435);
        limpiar();
        cliente = client;
        us.setText("CLIENTE:"+cliente);
        this.user = user;
        sA = estado.get(0);
        re = estado.get(1);
        fe = estado.get(2);
        cC = estado.get(3);
        
        setLocationRelativeTo(this);
    }
    
    public void limpiar(){
        sA.clear();
        re.clear();
        fe.clear();        
        cC.clear();
    }
    
    public void visualizar(){
        DefaultTableModel modelo = (DefaultTableModel) tabla.getModel();
        if(!sA.isEmpty()){
            
            for (int i = 0; i                           
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        error = new javax.swing.JLabel();
        aceptar = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabla = new javax.swing.JTable();
        mensaje = new javax.swing.JLabel();
        us = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/logo.png"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 547, 112);

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cinta.png"))); // NOI18N
        getContentPane().add(jLabel3);
        jLabel3.setBounds(0, 380, 547, 28);

        error.setBackground(new java.awt.Color(255, 255, 255));
        error.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        error.setForeground(new java.awt.Color(255, 0, 0));
        getContentPane().add(error);
        error.setBounds(20, 350, 520, 0);

        aceptar.setBackground(new java.awt.Color(102, 255, 102));
        aceptar.setFont(new java.awt.Font("Century Gothic", 1, 24)); // NOI18N
        aceptar.setText("ACEPTAR");
        aceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarActionPerformed(evt);
            }
        });
        getContentPane().add(aceptar);
        aceptar.setBounds(190, 330, 170, 50);

        jLabel6.setFont(new java.awt.Font("Euphemia", 1, 18)); // NOI18N
        jLabel6.setText("U L T I M O S   M O V I M I E N T O S");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(70, 110, 410, 25);

        tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Saldo Anterior", "Retiro", "Fecha", "Cajero"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(tabla);

        getContentPane().add(jScrollPane2);
        jScrollPane2.setBounds(10, 140, 530, 130);

        mensaje.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        mensaje.setForeground(new java.awt.Color(255, 0, 0));
        getContentPane().add(mensaje);
        mensaje.setBounds(10, 280, 520, 20);

        us.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        getContentPane().add(us);
        us.setBounds(10, 300, 210, 20);

        pack();
    }// 
private void aceptarActionPerformed(java.awt.event.ActionEvent evt) {                                        
        Principal2 on = new Principal2(cliente, user);
        on.setVisible(true);
        this.setVisible(false);
    }                                       

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ultimosCambios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ultimosCambios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ultimosCambios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ultimosCambios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //
        //

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                
     }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton aceptar;
    private javax.swing.JLabel error;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel mensaje;
    private javax.swing.JTable tabla;
    private javax.swing.JLabel us;
    // End of variables declaration                   
} 
Link de video para explicación  🔽🔽
 

Link de descarga del proyecto:


http://raboninco.com/GCVk 

http://raboninco.com/GCVk

EXTRA!!!
si quieres convertir tu servidor de forma remota o publica, es decir, que este disponible a todo el mundo, de esta menera podrás acceder a el desde cualquier lugar que tenga acceso a Internet, puedes seguir el siguiente link:
https://ivanovich-hacker.blogspot.com/2019/02/configurar-mi-propio-servidor-web-http.html
También les dejo un video para la explicación:


Alguna duda o pregunta dejar su comentario y les estaré respondiendo.
Created By Ivanovich. Iván Luis J.

Comentarios

  1. Buenas tardes, me saca el siguiente error import org.apache.xmlrpc.XmlRpcClient;

    me puedes decir que hacer por favor ?


    ResponderBorrar
    Respuestas
    1. Suele suceder porque cuando descargar e intentas compilar, la ruta de .jar de la librería no ha sido encontrada. Te recomiendo que al descargar, hagas una copia de las librerías, hecho eso, importarlas nuevamente, y compila.

      Borrar
  2. cuando ingreso usuario y clave, no pasa nada y genera este error...
    Exception in thread "Thread-3" java.lang.InstantiationError: org.apache.xmlrpc.XmlRpcRequest
    at org.apache.xmlrpc.XmlRpcRequestProcessor.processRequest(XmlRpcRequestProcessor.java:118)
    at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:182)
    at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151)
    at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
    at org.apache.xmlrpc.WebServer$Connection.run(WebServer.java:773)
    at org.apache.xmlrpc.WebServer$Runner.run(WebServer.java:656)
    at java.lang.Thread.run(Thread.java:745)

    ResponderBorrar
  3. una pregunta donde descargaste tus librerías

    ResponderBorrar
  4. El banco XYZ necesita desarrollar un sistema online en el cualsus usuarios puedan revisar su estado de cuenta por internet. Para esto, se necesita desarrollar la lógica inicial de la siguientemanera: a. Los usuarios(ej. Cliente1 y Cliente2) deberán ingresarsusrespectivas credenciales(usuario y contraseña) qué, inicialmente se las otorga el propio sistema del banco. (Se debe tomar en consideración que la institución bancaria, solo otorga este sistema a los usuarios que mantengan un depósito mínimo de $1,500 en suscuentas). Una vez el cliente haya ingresado por primera vez en la cuenta, el sistema debe mostrar la fecha y hora de ingreso. Y, a su vez, le debe pedir que actualice (cambie) la contraseña. c. Luego de haber cambiado la contraseña, elsistema debe mostrar al cliente un menú con el siguiente formato: 1) Ver estado de la cuenta:se debe mostrar los movimientos de saldo que ha tenido el cliente. (Ej. el monto inicial y el monto final de la cuenta). 2) Solicitar un Crédito: El banco está en la potestad de utilizar hasta un 90% delsaldo actual de una 3ra cuenta para prestar al cliente. (Ej. Puede utilizar hasta un 90% delsaldo del cliente2 para prestárselo al cliente1) y debe mostrar que el banco cobrará un 30% del valor prestado como comisión. 3) Cambiar contraseña: El cliente puede cambiarsu contraseña de acceso. 4) Salir: Termina el proceso y debe mostrar la fecha y hora en la que el cliente cerró la sesión.
    Como implementar los usuarios y contraseñas

    ResponderBorrar
  5. Se puede conectar mas de un cliente al servidor ???

    ResponderBorrar
  6. se tiene que crear una cuenta o algo así porque el enlace a lo que me envía es a lo de las monedas virtuales

    ResponderBorrar
    Respuestas
    1. Esas son mmdas xd.
      El codigo prob este, pero la cantidad de anuncios que puso hace casi imposible tener el proyecto

      Borrar
  7. Oye bro, me pone este error:
    package org.apache.xmlrpc does not exist

    ResponderBorrar
    Respuestas
    1. necesitas descargar una libreria

      Borrar
    2. https://repo1.maven.org/maven2/xmlrpc/xmlrpc/1.2-b1/

      Borrar

Publicar un comentario