0% found this document useful (0 votes)
9 views4 pages

User Data Display in Java GUI

Uploaded by

nirmaljayan9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

User Data Display in Java GUI

Uploaded by

nirmaljayan9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package demo;

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

/**
*
* @author hp
*/
public class display extends [Link] {

/**
* Creates new form display
*/
public display() {
initComponents();
show_user();
}
public ArrayList<vieww> al(){
ArrayList<vieww> al=new ArrayList<>();
vieww disp;
try {

Connection con=[Link]();
Statement st=[Link]();
String query = "SELECT * FROM reg";
ResultSet rs=[Link](query);
while([Link]())
{
disp = new
vieww([Link]("name"),[Link]("age"),[Link]("address"),[Link]
("gender"),[Link]("uname"),[Link]("pass"));
[Link](disp);
}
}
catch (SQLException ex) {
[Link]([Link]()).log([Link],
null, ex);
}
return al;

}
public void show_user(){
ArrayList<vieww> list= al();
DefaultTableModel model =(DefaultTableModel)[Link]();
Object [] row=new Object[6];
for(int i=0;i<[Link]();i++)
{
row[0]=[Link](i).getNm();
row[1]=[Link](i).getAg();
row[2]=[Link](i).getAdd();
row[3]=[Link](i).getG();
row[4]=[Link](i).getUn();
row[5]=[Link](i).getPas();
[Link](row);
}
}
/**
* 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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

name = new [Link]();


age = new [Link]();
address = new [Link]();
gender = new [Link]();
jScrollPane1 = new [Link]();
tble = new [Link]();

setDefaultCloseOperation([Link].EXIT_ON_CLOSE);

[Link](new [Link](
new Object [][] {
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null}
},
new String [] {
"name", "age", "address", "gender", "username", "password"
}
));
[Link](tble);

[Link] layout = new


[Link](getContentPane());
getContentPane().setLayout(layout);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(135, 135, 135)
.addGroup([Link]([Link]
[Link], false)
.addComponent(name)
.addComponent(age)
.addComponent(address)
.addComponent(gender, [Link].DEFAULT_SIZE, 94,
Short.MAX_VALUE))
.addGap(18, 18, 18)
.addComponent(jScrollPane1, [Link].DEFAULT_SIZE,
442, Short.MAX_VALUE)
.addGap(20, 20, 20))
);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(56, 56, 56)
.addComponent(name, [Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE, [Link].PREFERRED_SIZE)
.addGap(26, 26, 26)
.addComponent(age, [Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE, [Link].PREFERRED_SIZE)
.addGap(35, 35, 35)
.addComponent(address, [Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE, [Link].PREFERRED_SIZE)
.addGap(33, 33, 33)
.addComponent(gender, [Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE, [Link].PREFERRED_SIZE)
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup([Link],
[Link]()
.addContainerGap(14, Short.MAX_VALUE)
.addComponent(jScrollPane1, [Link].PREFERRED_SIZE,
275, [Link].PREFERRED_SIZE)
.addContainerGap())
);

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

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
[Link]
*/
try {
for ([Link] info :
[Link]()) {
if ("Nimbus".equals([Link]())) {
[Link]([Link]());
break;
}
}
} catch (ClassNotFoundException ex) {

[Link]([Link]()).log([Link].L
[Link], null, ex);
} catch (InstantiationException ex) {

[Link]([Link]()).log([Link].L
[Link], null, ex);
} catch (IllegalAccessException ex) {
[Link]([Link]()).log([Link].L
[Link], null, ex);
} catch ([Link] ex) {

[Link]([Link]()).log([Link].L
[Link], null, ex);
}
//</editor-fold>

/* Create and display the form */


[Link](new Runnable() {
public void run() {

try {

Connection con=[Link]();
Statement st=[Link]();
String query = "SELECT * FROM reg";
ResultSet rs=[Link](query);
while([Link]())
{

String Name = [Link]("name");


String age = [Link]("age");
String add = [Link]("address");
String gender = [Link]("gender");

[Link]("%s, %s, %s, %s\n", Name, age, add, gender);


// [Link]([Link]("name"));
}
[Link]();
new display().setVisible(true);
} catch (SQLException ex) {
[Link]([Link]()).log([Link],
null, ex);
}
}
});
}

// Variables declaration - do not modify


private [Link] address;
private [Link] age;
private [Link] gender;
private [Link] jScrollPane1;
private [Link] name;
private [Link] tble;
// End of variables declaration
}

You might also like