Cargar

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

package PROGRAMA;

import javax.swing.table.DefaultTableModel;

public class MostrarUsuario extends javax.swing.JFrame {

Ejecutar ejecutar[];
public DefaultTableModel modelo;

public MostrarUsuario(Ejecutar ejecutar[]) {


this.ejecutar = ejecutar;
initComponents();
PASAR();
}

private void PASAR() {

String llenado [][] = new String[ejecutar.length][6];

for (int i = 0; i < ejecutar.length; i++) {


if(ejecutar[i] != null){
llenado[i][0] = String.valueOf(ejecutar[i].getId());
llenado[i][1] = ejecutar[i].getNom();
llenado[i][2] = ejecutar[i].getApell();
llenado[i][3] = ejecutar[i].getUser();
llenado[i][4] = String.valueOf(ejecutar[i].getrol());
llenado[i][5] = ejecutar[i].getPass();
}
}

TablaDatos.setModel(new javax.swing.table.DefaultTableModel(
llenado,
new String [] {
"ID", "Nombre", "Apellido", "Usuario", "Rol", "Contraseña"
}
));

@SuppressWarnings("checked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jScrollPane1 = new javax.swing.JScrollPane();
TablaDatos = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N


jLabel1.setText("USUARIOS REGISTRADOS");

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

},
new String [] {
}
));
jScrollPane1.setViewportView(TablaDatos);

jButton1.setText("VOLVER");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(248, 248, 248)
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 94,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(187, 187, 187)
.addComponent(jLabel1)))
.addGap(0, 181, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 575,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
269, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 36,
Short.MAX_VALUE)
.addContainerGap())
);

pack();
}// </editor-fold>

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {


ADMINISTRADOR ADM = new ADMINISTRADOR(ejecutar);
ADM.setVisible(true);
this.dispose();
}

// Variables declaration - do not modify


public static javax.swing.JTable TablaDatos;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration

You might also like