What will You Learn

public class MobileReparingProject {

public static void main(String[] args) throws SQLException {
new MyMobileReparing();
}

}
class MyMobileReparing extends JFrame{
public MyMobileReparing() throws SQLException{
super();
setTitle(" Mobile Reparing Center ");
setSize ( 800,700);
PrograssBarPanel p1= new PrograssBarPanel();
this.getContentPane().add(p1);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
super.setVisible(true);
p1.fill();
}
}
public class PrograssBarPanel extends JPanel {
JProgressBar pb;
JButton icon;
public PrograssBarPanel(){
icon=new JButton();
icon.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc = new ImageIcon(((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\download.jpg").getImage()
.getScaledInstance(160, 160,Image.SCALE_SMOOTH))));
icon.setIcon(imgc);

UIManager.put("ProgressBar.selectionForeground", Color.white);
UIManager.put("ProgressBar.selectionBackground", Color.BLACK);
pb = new JProgressBar(); pb.setBackground(Color.white);
pb.setForeground(Color.red);pb.setPreferredSize(new Dimension(300, 30));
pb.setValue(0);
pb.setStringPainted(true);
this.setLayout(new GridBagLayout());

this.add(icon);this.add(pb);
this.setBackground(Color.WHITE);
}
LoginPanel lp;
public void fill()
{
int i = 0;
try {
while (i <= 100) {
pb.setValue(i + 1);
Thread.sleep(30);
i += 1;
}
this.removeAll();
this.repaint();
this.revalidate();

lp=new LoginPanel();

this.add(lp);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
catch (Exception e) {
System.out.println("Danish");
}
}
}
public class LoginPanel extends JPanel implements KeyListener,ActionListener,FocusListener{
JButton ok,image;
JLabel l_username,l_password,error,forgot;
JTextField t_username;
JPasswordField t_password;
JPanel p1,p2;

public LoginPanel(){
ok = new JButton(" Login ");ok.addActionListener(this); ok.addKeyListener(this);
image = new JButton();

image.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc = new ImageIcon(((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\download.jpg").getImage()
.getScaledInstance(160, 160,Image.SCALE_SMOOTH))));
image.setIcon(imgc);

error=new JLabel();error.setForeground(Color.cyan);
l_username = new JLabel(" Username ");
l_password = new JLabel(" Password ");
forgot=new JLabel(" Forgot Password ? ");forgot.setForeground(Color.cyan);
t_username = new JTextField(15); t_username.addKeyListener(this);t_username.addFocusListener(this);
t_password = new JPasswordField(15);t_password.addFocusListener(this);

Font f1=new Font("TimesRoman", Font.BOLD, 18);
Font f2=new Font("TimesRoman", Font.PLAIN, 18);
l_username.setFont(f1);l_username.setForeground(Color.WHITE);
l_password.setFont(f1);l_password.setForeground(Color.WHITE);
t_username.setFont(f2);
t_password.setFont(f2);
ok.setFont(f1);ok.setForeground(Color.WHITE);ok.setBackground(Color.blue);

p1 = new JPanel(new GridBagLayout());
GridBagConstraints c1= new GridBagConstraints();
c1.anchor=GridBagConstraints.LINE_END;
p1.add(image,c1);
//p1.setPreferredSize(new Dimension(170, 250));
p1.setBackground(Color.BLACK);

p2 = new JPanel(new GridBagLayout());
GridBagConstraints c= new GridBagConstraints();
c.insets = new Insets(20,0,0,0);
c.gridx=0;c.gridy=0;p2.add(l_username,c);
c.gridx=1;c.gridy=0;p2.add(t_username,c);
c.gridx=0;c.gridy=1;p2.add(l_password,c);
c.gridx=1;c.gridy=1;p2.add(t_password,c);
c.gridx=1;c.gridy=2;c.anchor=GridBagConstraints.LINE_END;p2.add(forgot,c);
c.gridx=1;c.gridy=3; c.anchor=GridBagConstraints.LINE_START ;p2.add(ok,c);
c.gridx=1;c.gridy=4;p2.add(error,c);
p2.setBackground(Color.BLACK);
p2.setPreferredSize(new Dimension(360, 250));

this.setBackground(Color.BLACK);
this.setLayout(new GridBagLayout());
GridBagConstraints cf= new GridBagConstraints();
cf.gridx=0;cf.gridy=0;this.add(p1,cf);
cf.gridx=0;cf.gridy=1;this.add(p2,cf);
}

public void actionPerformed(ActionEvent e){

if(e.getSource() == ok){
String user = t_username.getText();
String pass = t_password.getText();
if(user.equals("admin") && pass.equals("1234"))
{
this.removeAll();
this.repaint();
this.revalidate();

DashBoard d1=new DashBoard();

this.add(d1);
this.repaint();
this.revalidate();
this.setBackground(Color.LIGHT_GRAY);
}
else if(user.equals("")||pass.equals(""))
{
error.setText("Username or Password is empty ");
}
else{
error.setText("Username or Password is not correct ");
}
}
}

@Override
public void keyTyped(KeyEvent ke) {

char ch;
ch = ke.getKeyChar();
if((ch < 'a' || ch > 'z' ) && (ch != '\b') ){
ke.consume();
}
}

@Override
public void keyPressed(KeyEvent ke) {
if(ke.getSource() == ok){
if (ke.getKeyCode()==KeyEvent.VK_ENTER) {
ok.doClick();
}
}
}


@Override
public void keyReleased(KeyEvent ke) {

}

@Override
public void focusGained(FocusEvent fe) {

if(fe.getSource().equals(t_username)|| fe.getSource().equals(t_password)){
error.setText("");
}
}

@Override
public void focusLost(FocusEvent fe) {

}
}
public class DashBoard extends JPanel implements ActionListener{
JLabel heding,Reg,UnRep,Rep,Recv,Rop,exit;
JButton imReg,imUnRep,imRep,imRecv,imRop,imexit;
JPanel p;

Font f1=new Font("TimesRoman", Font.BOLD, 35);
Font f2=new Font("TimesRoman", Font.BOLD, 20);
public DashBoard(){
heding=new JLabel("Mobile Reparing Center"); heding.setFont(f1);
Reg=new JLabel("Register"); Reg.setFont(f2);
UnRep=new JLabel("UnRepaire Mobile"); UnRep.setFont(f2);
Rep=new JLabel("Repair Mobile"); Rep.setFont(f2);
Recv=new JLabel("Received Mobile"); Recv.setFont(f2);
Rop=new JLabel("Report"); Rop.setFont(f2);
exit=new JLabel("Exit"); exit.setFont(f2);

heding.setForeground(Color.white);
Reg.setForeground(Color.white);
UnRep.setForeground(Color.white);
Rep.setForeground(Color.white);
Recv.setForeground(Color.white);
Rop.setForeground(Color.white);
exit.setForeground(Color.white);

imReg=new JButton();imReg.addActionListener(this);
imUnRep=new JButton();imUnRep.addActionListener(this);
imRep=new JButton();imRep.addActionListener(this);
imRecv=new JButton();imRecv.addActionListener(this);
imRop=new JButton();imRop.addActionListener(this);
imexit=new JButton();imexit.addActionListener(this);

imReg.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc1=new ImageIcon((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\add.png").getImage()
.getScaledInstance(150,150,Image.SCALE_SMOOTH)));
imReg.setIcon(imgc1);

imUnRep.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc2=new ImageIcon((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\unrep.jpg").getImage()
.getScaledInstance(150,150,Image.SCALE_SMOOTH)));
imUnRep.setIcon(imgc2);

imRep.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc3=new ImageIcon((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\rep.jpg").getImage()
.getScaledInstance(150,150,Image.SCALE_SMOOTH)));
imRep.setIcon(imgc3);

imRecv.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc4=new ImageIcon((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\rev.jpg").getImage()
.getScaledInstance(150,150,Image.SCALE_SMOOTH)));
imRecv.setIcon(imgc4);

imRop.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc5=new ImageIcon((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\rop.jpg").getImage()
.getScaledInstance(150,150,Image.SCALE_SMOOTH)));
imRop.setIcon(imgc5);

imexit.setBorder(BorderFactory.createEmptyBorder());
ImageIcon imgc6=new ImageIcon((new ImageIcon("C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\exit.jpg").getImage()
.getScaledInstance(150,150,Image.SCALE_SMOOTH)));
imexit.setIcon(imgc6);

p=new JPanel(new GridBagLayout());
GridBagConstraints c1= new GridBagConstraints();
c1.anchor=GridBagConstraints.CENTER;
c1.gridx=0;c1.gridy=0;c1.insets=new Insets(30,30,0,30);p.add(imReg,c1);
c1.gridx=0;c1.gridy=1;c1.insets=new Insets(0,0,0,0);p.add(Reg,c1);
c1.gridx=1;c1.gridy=0;c1.insets=new Insets(30,30,0,30);p.add(imUnRep,c1);
c1.gridx=1;c1.gridy=1;c1.insets=new Insets(0,0,0,0);p.add(UnRep,c1);
c1.gridx=2;c1.gridy=0;c1.insets=new Insets(30,30,0,30);p.add(imRep,c1);
c1.gridx=2;c1.gridy=1;c1.insets=new Insets(0,0,0,0);p.add(Rep,c1);
c1.gridx=0;c1.gridy=2;c1.insets=new Insets(30,30,0,30);p.add(imRecv,c1);
c1.gridx=0;c1.gridy=3;c1.insets=new Insets(0,0,0,0);p.add(Recv,c1);
c1.gridx=1;c1.gridy=2;c1.insets=new Insets(30,30,0,30);p.add(imRop,c1);
c1.gridx=1;c1.gridy=3;c1.insets=new Insets(0,0,0,0);p.add(Rop,c1);
c1.gridx=2;c1.gridy=2;c1.insets=new Insets(30,30,0,30);p.add(imexit,c1);
c1.gridx=2;c1.gridy=3;c1.insets=new Insets(0,0,0,0);p.add(exit,c1);
p.setBackground(Color.BLACK);

this.setBackground(Color.black);
this.setLayout(new GridBagLayout());
GridBagConstraints c= new GridBagConstraints();
c.insets=new Insets(30,0,0,0);
c.gridx=0;c.gridy=0;this.add(heding,c);
c.gridx=0;c.gridy=1;this.add(p,c);
}

@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource().equals(imReg)){
this.removeAll();
this.repaint();
this.revalidate();

RegisterPanel r1=new RegisterPanel();

this.add(r1);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
if(ae.getSource().equals(imUnRep)){
this.removeAll();
this.repaint();
this.revalidate();

UnRepairPanel up=new UnRepairPanel();

this.add(up);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
if(ae.getSource().equals(imRep)){
this.removeAll();
this.repaint();
this.revalidate();

RepairPanel rp=new RepairPanel();

this.add(rp);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
if(ae.getSource().equals(imRop)){
this.removeAll();
this.repaint();
this.revalidate();

ReportPanel up;
try {
up = new ReportPanel();
this.add(up);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
} catch (SQLException ex) {
}
}
if(ae.getSource().equals(imRecv)){
this.removeAll();
this.repaint();
this.revalidate();

try {
RecivePanel recp=new RecivePanel();
this.add(recp);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
} catch (SQLException ex) {
}
}
if(ae.getSource().equals(imexit)){
System.exit(0);
}

}
}
public class Register {
private String customerName,email,mobileNo,adress,productName,imei,model,type,fault;

public Register(String customerName, String email, String mobileNo, String adress, String productName, String imei, String model, String type, String fault) {
this.customerName = customerName;
this.email = email;
this.mobileNo = mobileNo;
this.adress = adress;
this.productName = productName;
this.imei = imei;
this.model = model;
this.type = type;
this.fault = fault;
}

Register() {
}
public String getCustomerName() {
return customerName;
}

public void setCustomerName(String customerName) {
this.customerName = customerName;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getMobileNo() {
return mobileNo;
}

public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}

public String getAdress() {
return adress;
}

public void setAdress(String adress) {
this.adress = adress;
}

public String getProductName() {
return productName;
}

public void setProductName(String productName) {
this.productName = productName;
}

public String getImei() {
return imei;
}

public void setImei(String imei) {
this.imei = imei;
}

public String getModel() {
return model;
}

public void setModel(String model) {
this.model = model;
}

public String getType() {
return type;
}

public void setType(String tupe) {
this.type = tupe;
}

public String getFault() {
return fault;
}

public void setFault(String fault) {
this.fault = fault;
}
}
public class RegisterPanel extends JPanel implements ActionListener{

JLabel cusDetail,cusName,cusMobileNo,cusAdress,cusEmail;
JTextField tName,tMobileNo,tEmail;
JTextArea tAdress;

JLabel pDetail,pName,pImei,pModel,pType,pFaultDescription;
JRadioButton tablet,handset;
ButtonGroup pTypeGroup;
JTextField tpName,tpModel,tpImei;
JTextArea tpFaultDetail;
JPanel radioButtonPane,pf,buttonPane;
JButton reg,back;
Connection con;
Register register=new Register();

Font f=new Font("TimesRoman", Font.BOLD, 25);
Font f1=new Font("TimesRoman", Font.BOLD, 18);
Font f2=new Font("TimesRoman", Font.PLAIN, 15);

public RegisterPanel( ){
super();

// Customer Detail Panel
cusDetail=new JLabel(" Customer Detail ");cusDetail.setForeground(Color.white);
cusName=new JLabel(" Name ");cusName.setForeground(Color.white);
cusMobileNo=new JLabel(" Mobile No. ");cusMobileNo.setForeground(Color.white);
cusAdress=new JLabel(" Adress ");cusAdress.setForeground(Color.white);
cusEmail=new JLabel(" Email ");cusEmail.setForeground(Color.white);
tName=new JTextField(25);
tMobileNo=new JTextField(25);
tEmail=new JTextField(25);
tAdress=new JTextArea();
tAdress.setPreferredSize(new Dimension(330, 80));
tAdress.setLineWrap(true);

cusDetail.setFont(f);
cusName.setFont(f1);cusMobileNo.setFont(f1);
cusAdress.setFont(f1);cusEmail.setFont(f1);
tName.setFont(f2);tMobileNo.setFont(f2);
tEmail.setFont(f2);tAdress.setFont(f2);
pf=new JPanel(new GridBagLayout());
// super.setLayout(new GridBagLayout());
GridBagConstraints c1= new GridBagConstraints();
c1.insets=new Insets(10,0,0,0);
c1.anchor=GridBagConstraints.LINE_START;
c1.gridx=0;c1.gridy=0;pf.add(cusDetail,c1);
c1.gridx=0;c1.gridy=1;pf.add(cusName,c1);
c1.gridx=1;c1.gridy=1;pf.add(tName,c1);
c1.gridx=0;c1.gridy=2;pf.add(cusMobileNo,c1);
c1.gridx=1;c1.gridy=2;pf.add(tMobileNo, c1);
c1.gridx=0;c1.gridy=3;pf.add(cusEmail,c1);
c1.gridx=1;c1.gridy=3;pf.add(tEmail,c1);
c1.gridx=0;c1.gridy=4;c1.anchor=GridBagConstraints.NORTHWEST;pf.add(cusAdress,c1);
c1.gridx=1;c1.gridy=4;pf.add(tAdress,c1);

// Mobile Detail Panel
pDetail=new JLabel(" Product Detail ");pDetail.setForeground(Color.white);
pName=new JLabel(" Name ");pName.setForeground(Color.white);
pImei=new JLabel(" IMEI ");pImei.setForeground(Color.white);
pModel=new JLabel(" Model ");pModel.setForeground(Color.white);
pType=new JLabel(" Type ");pType.setForeground(Color.white);
pFaultDescription=new JLabel(" Fault Description ");pFaultDescription.setForeground(Color.white);
tpName=new JTextField(25);
tpModel=new JTextField(25);
tpImei=new JTextField(25);
tpFaultDetail=new JTextArea();tpFaultDetail.setPreferredSize(new Dimension(330, 80));
tpFaultDetail.setLineWrap(true);
tablet=new JRadioButton(" Tablet "); tablet.setBackground(Color.BLACK);
tablet.setForeground(Color.white); tablet.setFont(f1);
handset=new JRadioButton(" HandSet ");handset.setBackground(Color.BLACK);
handset.setForeground(Color.white); handset.setFont(f1);
pTypeGroup=new ButtonGroup();
pTypeGroup.add(tablet);pTypeGroup.add(handset);

back=new JButton("Main Menu");back.setForeground(Color.white);
back.setFont(f1);back.setBackground(Color.BLUE);
back.addActionListener(this);
reg=new JButton(" Register ");reg.setForeground(Color.white);
reg.setBackground(Color.BLUE);reg.setFont(f1);
// Action Listener in Add Button
reg.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent ae) {
if(tName.getText().equals("")&&
tMobileNo.getText().equals("")&&
tEmail.getText().equals("")&&
tAdress.getText().equals("")&&
tpName.getText().equals("")&&
tpImei.getText().equals("")&&
tpModel.getText().equals("")&&
tpFaultDetail.getText().equals("")){
JOptionPane.showMessageDialog(null, "Please Enter Full Detail ");
}else{
register.setCustomerName(tName.getText());
register.setMobileNo(tMobileNo.getText());
register.setEmail(tEmail.getText());
register.setAdress(tAdress.getText());
register.setProductName(tpName.getText());
register.setImei(tpImei.getText());
register.setModel(tpModel.getText());
register.setFault(tpFaultDetail.getText());
//checked Selected Radio Button
String radioB_select="";
if(tablet.isSelected()){radioB_select=tablet.getText();}
if(handset.isSelected()){radioB_select=handset.getText();}
register.setType(radioB_select);

//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
// Step:-3) Statement SQL
String query="insert into UnRepairMobile(CustomerName,MobileNo,Email,Adress,MobileName,Model,IMIE,Type,FaultDescription)"+" values(?,?,?,?,?,?,?,?,?)";
String query2="insert into Report(CustomerName,MobileNo,Email,Adress,MobileName,Model,IMIE,Type,FaultDescription)"+" values(?,?,?,?,?,?,?,?,?)";
//Step:-4) Insert Data
try {
PreparedStatement pst=con.prepareStatement(query);
pst.setString(1, register.getCustomerName());
pst.setString(2, register.getMobileNo());
pst.setString(3, register.getEmail());
pst.setString(4,register.getAdress());
pst.setString(5,register.getProductName());
pst.setString(6,register.getModel());
pst.setString(7,register.getImei());
pst.setString(8, register.getType());
pst.setString(9,register.getFault());
pst.executeUpdate();

//Step:-5) Connection Close
con.close();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}

try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}

try {
PreparedStatement pst=con.prepareStatement(query2);
pst.setString(1, register.getCustomerName());
pst.setString(2, register.getMobileNo());
pst.setString(3, register.getEmail());
pst.setString(4,register.getAdress());
pst.setString(5,register.getProductName());
pst.setString(6,register.getModel());
pst.setString(7,register.getImei());
pst.setString(8, register.getType());
pst.setString(9,register.getFault());
pst.executeUpdate();

//Step:-5) Connection Close
con.close();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}

JOptionPane.showMessageDialog(null," Mobile Register ");

tName.setText("");
tMobileNo.setText("");
tEmail.setText("");
tAdress.setText("");
tpName.setText("");
tpModel.setText("");
tpImei.setText("");
tpFaultDetail.setText("");
pTypeGroup.clearSelection();
} }
});
pDetail.setFont(f);
pName.setFont(f1);pImei.setFont(f1);
pModel.setFont(f1);pType.setFont(f1);
pFaultDescription.setFont(f1);
tpName.setFont(f2);tpModel.setFont(f2);
tpImei.setFont(f2);tpFaultDetail.setFont(f2);

radioButtonPane=new JPanel();
radioButtonPane.add(tablet);radioButtonPane.add(handset);
radioButtonPane.setBackground(Color.BLACK);

c1.gridx=0;c1.gridy=5;pf.add(pDetail,c1);
c1.gridx=0;c1.gridy=6;pf.add(pName,c1);
c1.gridx=1;c1.gridy=6;pf.add(tpName,c1);
c1.gridx=0;c1.gridy=7;pf.add(pModel,c1);
c1.gridx=1;c1.gridy=7;pf.add(tpModel,c1);
c1.gridx=0;c1.gridy=8;pf.add(pImei,c1);
c1.gridx=1;c1.gridy=8;pf.add(tpImei,c1);
c1.gridx=0;c1.gridy=9;pf.add(pType, c1);
c1.gridx=1;c1.gridy=9;c1.anchor=GridBagConstraints.CENTER;pf.add(radioButtonPane, c1);
c1.gridx=0;c1.gridy=10;c1.anchor=GridBagConstraints.NORTHWEST;pf.add(pFaultDescription, c1);
c1.gridx=1;c1.gridy=10;pf.add(tpFaultDetail, c1);

buttonPane=new JPanel(new GridBagLayout());
GridBagConstraints c3= new GridBagConstraints();
c3.insets=new Insets(0,10,0,0);
c3.gridx=0;c3.gridy=0;buttonPane.add(reg,c3);
c3.gridx=1;c3.gridy=0;buttonPane.add(back,c3);
buttonPane.setBackground(Color.BLACK);

c1.gridx=1;c1.gridy=11;pf.add(buttonPane, c1);

pf.setBackground(Color.BLACK);
pf.setPreferredSize(new Dimension(600, 600));
this.add(pf);
this.setBackground(Color.BLACK);
}

@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource().equals(back)){
this.removeAll();
this.repaint();
this.revalidate();

DashBoard d1=new DashBoard();

this.add(d1);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
}
}
public class UnRepairPanel extends JPanel implements ActionListener{

JLabel cusDetail,cusName,cusMobileNo,cusAdress,cusEmail;
JTextField tName,tMobileNo,tEmail;
JTextArea tAdress;

JLabel pDetail,pName,pImei,pModel,pType,pMainFault,pFaultDescription;
JRadioButton tablet,handset;
ButtonGroup pTypeGroup;
JTextField tpName,tpModel,tpImei;
JTextArea tpFaultDetail;
JPanel radioButtonPane,pf,searchPane,buttonPane;
JButton update,search,back,repair;
Connection con;
Register register=new Register();

Font f=new Font("TimesRoman", Font.BOLD, 35);
Font f1=new Font("TimesRoman", Font.BOLD, 18);
Font f2=new Font("TimesRoman", Font.PLAIN, 15);

public UnRepairPanel( ){
super();

search=new JButton("Search");search.setForeground(Color.white);
search.setFont(f1);search.setBackground(Color.BLUE);
back=new JButton("Main Menu");back.setForeground(Color.white);
back.setFont(f1);back.setBackground(Color.BLUE);
back.addActionListener(this);
repair=new JButton("Repair");repair.setForeground(Color.white);
repair.setFont(f1);repair.setBackground(Color.BLUE);

// Customer Detail Panel
cusDetail=new JLabel(" Customer Detail ");cusDetail.setForeground(Color.white);
cusName=new JLabel(" Name ");cusName.setForeground(Color.white);
cusMobileNo=new JLabel(" Mobile No. ");cusMobileNo.setForeground(Color.white);
cusAdress=new JLabel(" Adress ");cusAdress.setForeground(Color.white);
cusEmail=new JLabel(" Email ");cusEmail.setForeground(Color.white);
tName=new JTextField(25);
tMobileNo=new JTextField(25);
tEmail=new JTextField(25);
tAdress=new JTextArea();
tAdress.setPreferredSize(new Dimension(330, 80));
tAdress.setLineWrap(true);

cusDetail.setFont(f);
cusName.setFont(f1);cusMobileNo.setFont(f1);
cusAdress.setFont(f1);cusEmail.setFont(f1);
tName.setFont(f2);tMobileNo.setFont(f2);
tEmail.setFont(f2);tAdress.setFont(f2);

pf=new JPanel(new GridBagLayout());
GridBagConstraints c1= new GridBagConstraints();
c1.insets=new Insets(10,0,0,0);
c1.anchor=GridBagConstraints.LINE_START;
c1.gridx=0;c1.gridy=0;pf.add(cusDetail,c1);
c1.gridx=0;c1.gridy=1;pf.add(cusName,c1);
c1.gridx=1;c1.gridy=1;pf.add(tName,c1);
c1.gridx=0;c1.gridy=2;pf.add(cusMobileNo,c1);
c1.gridx=1;c1.gridy=2;pf.add(tMobileNo, c1);
c1.gridx=0;c1.gridy=3;pf.add(cusEmail,c1);
c1.gridx=1;c1.gridy=3;pf.add(tEmail,c1);
c1.gridx=0;c1.gridy=4;c1.anchor=GridBagConstraints.NORTHWEST;pf.add(cusAdress,c1);
c1.gridx=1;c1.gridy=4;pf.add(tAdress,c1);

// Mobile Detail Panel
pDetail=new JLabel(" Product Detail ");pDetail.setForeground(Color.white);
pName=new JLabel(" Name ");pName.setForeground(Color.white);
pImei=new JLabel(" IMEI ");pImei.setForeground(Color.white);
pModel=new JLabel(" Model ");pModel.setForeground(Color.white);
pType=new JLabel(" Type ");pType.setForeground(Color.white);
pFaultDescription=new JLabel(" Fault Description ");pFaultDescription.setForeground(Color.white);
tpName=new JTextField(25);
tpModel=new JTextField(25);
tpImei=new JTextField(25);
tpFaultDetail=new JTextArea();tpFaultDetail.setPreferredSize(new Dimension(330, 80));
tpFaultDetail.setLineWrap(true);
tablet=new JRadioButton(" Tablet "); tablet.setBackground(Color.BLACK);
tablet.setForeground(Color.white); tablet.setFont(f1);
handset=new JRadioButton(" HandSet ");handset.setBackground(Color.BLACK);
handset.setForeground(Color.white); handset.setFont(f1);
pTypeGroup=new ButtonGroup();
pTypeGroup.add(tablet);pTypeGroup.add(handset);
update=new JButton(" Update ");update.setForeground(Color.white);
update.setBackground(Color.BLUE);update.setFont(f1);

pDetail.setFont(f);
pName.setFont(f1);pImei.setFont(f1);
pModel.setFont(f1);pType.setFont(f1);
tpName.setFont(f2);tpModel.setFont(f2);
tpImei.setFont(f2);tpFaultDetail.setFont(f2);

radioButtonPane=new JPanel();
radioButtonPane.add(tablet);radioButtonPane.add(handset);
radioButtonPane.setBackground(Color.BLACK);

c1.gridx=0;c1.gridy=5;pf.add(pDetail,c1);
c1.gridx=0;c1.gridy=6;pf.add(pName,c1);
c1.gridx=1;c1.gridy=6;pf.add(tpName,c1);
c1.gridx=0;c1.gridy=7;pf.add(pModel,c1);
c1.gridx=1;c1.gridy=7;pf.add(tpModel,c1);
c1.gridx=0;c1.gridy=8;pf.add(pImei,c1);
c1.gridx=1;c1.gridy=8;pf.add(tpImei,c1);
c1.gridx=0;c1.gridy=9;pf.add(pType, c1);
c1.gridx=1;c1.gridy=9;c1.anchor=GridBagConstraints.CENTER;pf.add(radioButtonPane, c1);
c1.gridx=0;c1.gridy=10;c1.anchor=GridBagConstraints.NORTHWEST;pf.add(pFaultDescription, c1);
c1.gridx=1;c1.gridy=10;pf.add(tpFaultDetail, c1);

buttonPane=new JPanel(new GridBagLayout());
GridBagConstraints c3= new GridBagConstraints();
c3.insets=new Insets(0,10,0,0);
c3.gridx=0;c3.gridy=0;buttonPane.add(update,c3);
c3.gridx=1;c3.gridy=0;buttonPane.add(repair,c3);
c3.gridx=2;c3.gridy=0;buttonPane.add(back,c3);
buttonPane.setBackground(Color.BLACK);

c1.gridx=1;c1.gridy=11;pf.add(buttonPane, c1);

repair.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
JFrame fr=new JFrame("Bill");
fr.setSize(600,600);
JButton ok;
JLabel problem,charg,servCharg,heading,imei;
JTextField tChar,tServCharg,t_imei;
JTextArea tProblem;
JPanel p;

ok=new JButton("Ok");ok.setForeground(Color.white);
ok.setFont(f1);ok.setBackground(Color.BLUE);
heading=new JLabel("Bill");heading.setFont(f);
charg=new JLabel("Charges");charg.setFont(f1);
servCharg=new JLabel("Service Charges");servCharg.setFont(f1);
problem=new JLabel("Faults Description");problem.setFont(f1);
imei=new JLabel("IMEI");imei.setFont(f1);

heading.setForeground(Color.white);
charg.setForeground(Color.white);
servCharg.setForeground(Color.white);
problem.setForeground(Color.white);
imei.setForeground(Color.white);

tProblem=new JTextArea();tProblem.setPreferredSize(new Dimension(250, 80));
tProblem.setText(tpFaultDetail.getText());
tChar=new JTextField(10);tChar.setFont(f2);
tServCharg=new JTextField(10);tServCharg.setFont(f2);
t_imei=new JTextField(19);t_imei.setFont(f2);
t_imei.setText(tpImei.getText());

p=new JPanel(new GridBagLayout());
GridBagConstraints c4= new GridBagConstraints();
c4.insets=new Insets(30,30,0,0);
c4.anchor=GridBagConstraints.LINE_START;
c4.gridx=1;c4.gridy=0;p.add(heading,c4);
c4.anchor=GridBagConstraints.LINE_START;
c4.gridx=0;c4.gridy=1;p.add(imei,c4);
c4.gridx=1;c4.gridy=1;p.add(t_imei,c4);
c4.gridx=0;c4.gridy=2;c4.anchor=GridBagConstraints.NORTHWEST;p.add(problem,c4);
c4.anchor=GridBagConstraints.LINE_START;
c4.gridx=1;c4.gridy=2;p.add(tProblem,c4);
c4.gridx=0;c4.gridy=3;p.add(charg,c4);
c4.gridx=1;c4.gridy=3;p.add(tChar,c4);
c4.gridx=0;c4.gridy=4;p.add(servCharg,c4);
c4.gridx=1;c4.gridy=4;p.add(tServCharg,c4);
c4.gridx=1;c4.gridy=5;p.add(ok,c4);
ok.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
// Step:-3) Statement SQL
String query="insert into Bill(IMEI,FaultDescription,Charges,ServiceCharges)"+" values(?,?,?,?)";

//Step:-4) Insert Data
try {
PreparedStatement pst=con.prepareStatement(query);
pst.setString(1, t_imei.getText());
pst.setString(2, tProblem.getText());
pst.setString(3, tChar.getText());
pst.setString(4, tServCharg.getText());
pst.executeUpdate();

//Step:-5) Connection Close
con.close();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
fr.setVisible(false);
JOptionPane.showMessageDialog(null, " Mobile Add in Repair ");
}
});
p.setBackground(Color.BLACK);
fr.add(p);
fr.setVisible(true);

//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
// Step:-3) Statement SQL
String query="insert into RepairMobile(CustomerName,MobileNo,Email,Adress,MobileName,Model,IMIE,Type,FaultDescription)"+" values(?,?,?,?,?,?,?,?,?)";

//Step:-4) Insert Data
try {
PreparedStatement pst=con.prepareStatement(query);
pst.setString(1, tName.getText());
pst.setString(2, tMobileNo.getText());
pst.setString(3, tEmail.getText());
pst.setString(4,tAdress.getText());
pst.setString(5,tpName.getText());
pst.setString(6,tpModel.getText());
pst.setString(7,tpImei.getText());
String pType = "";
if(tablet.isSelected()){pType=tablet.getText();}
if(handset.isSelected()){pType=handset.getText();}
pst.setString(8, pType);
pst.setString(9,tpFaultDetail.getText());
pst.executeUpdate();

//Step:-5) Connection Close
con.close();
} catch (SQLException ex) {
System.out.println("Danish");
System.out.println(ex.getMessage());
}

try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
try{
Statement st=con.createStatement();
String sql = " delete from UnRepairMobile where IMIE = '"+tpImei.getText()+"' ";
st.executeUpdate(sql);

//Step:-5) Connection Close
con.close();
}catch(SQLException ex){
System.out.println(ex.getMessage());
System.out.println("Danish");
}
tName.setText("");
tMobileNo.setText("");
tEmail.setText("");
tAdress.setText("");
tpName.setText("");
tpModel.setText("");
tpImei.setText("");
tpFaultDetail.setText("");
pTypeGroup.clearSelection();
}
});

search.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
//Step:-3) Statement SQL
String query=" Select* from UnRepairMobile where IMIE='"+tpImei.getText()+"' ";
try{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(query);

//Step:-4) Process Result
ResultSetMetaData md=rs.getMetaData();
int column=md.getColumnCount();
if(rs.next()){
tName.setText(rs.getObject("CustomerName").toString());
tMobileNo.setText(rs.getObject("MobileNo").toString());
tAdress.setText(rs.getObject("Adress").toString());
tEmail.setText(rs.getObject("Email").toString());
tpName.setText(rs.getObject("MobileName").toString());
tpImei.setText(rs.getObject("IMIE").toString());
tpModel.setText(rs.getObject("Model").toString());
tpFaultDetail.setText(rs.getObject("FaultDescription").toString());
String radioB_select=rs.getObject("Type").toString();
if(radioB_select.equals(" Tablet ")){tablet.setSelected(true);}
if(radioB_select.equals(" HandSet ")){handset.setSelected(true);}
}else {
JOptionPane.showMessageDialog(null, "Mobile is Already Repair or Dose't Exist ");
}

//Step:-5) Connection and Result Process Close
rs.close();con.close();

}catch(SQLException e){
e.printStackTrace();
System.out.println("Qurey incorrect ");
}
}
});

update.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
try {
Statement st=con.createStatement();
String cusName = tName.getText();
String cusMobile = tMobileNo.getText();
String cusEmail = tEmail.getText();
String cusAdress = tAdress.getText();
String pName = tpName.getText();
String pModel = tpModel.getText();
String pImie = tpImei.getText();
String pFault = tpFaultDetail.getText();
String pType = "";
if(tablet.isSelected()){pType=tablet.getText();}
if(handset.isSelected()){pType=handset.getText();}
//CustomerName,MobileNo,Email,Adress,MobileName,Model,IMIE,Type,FaultDescription
String query = " update UnRepairMobile set CustomerName ='"+ cusName +"',MobileNo='"+cusMobile+"',Email='"+cusEmail+"',Adress='"+cusAdress+"',MobileName='"+pName+"',Model='"+pModel+"',FaultDescription='"+pFault+"',Type='"+pType+"'where IMIE ="+pImie;
st.executeUpdate(query);
JOptionPane.showMessageDialog(null, " Data is successfully updated. ");
//Step:-5) Connection Close
con.close();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
}
});

pf.setBackground(Color.BLACK);


searchPane=new JPanel(new GridBagLayout());
GridBagConstraints c= new GridBagConstraints();
c.insets=new Insets(0,30,0,0);
c.gridx=0;c.gridy=0;searchPane.add(pImei,c);
c.gridx=1;c.gridy=0;searchPane.add(tpImei,c);
c.gridx=2;c.gridy=0;searchPane.add(search,c);
searchPane.setBackground(Color.BLACK);

this.setLayout(new GridBagLayout());
GridBagConstraints c2= new GridBagConstraints();
c2.insets=new Insets(20,0,0,0);
c2.gridx=0;c2.gridy=0;this.add(searchPane,c2);
c2.gridx=0;c2.gridy=1;this.add(pf,c2);
this.setBackground(Color.BLACK);
}

@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource().equals(back)){
this.removeAll();
this.repaint();
this.revalidate();

DashBoard d1=new DashBoard();

this.add(d1);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
}
}
public class RepairPanel extends JPanel implements ActionListener{
JTabbedPane tp;
JLabel cusDetail,cusName,cusMobileNo,cusAdress,cusEmail;
JTextField tName,tMobileNo,tEmail;
JTextArea tAdress;

JLabel pDetail,pName,pImei,pModel,pType,pMainFault,pFaultDescription;
JRadioButton tablet,handset;
ButtonGroup pTypeGroup;
JTextField tpName,tpModel,tpImei;
JTextArea tpFaultDetail;
JPanel radioButtonPane,pf,searchPane,buttonPane;
JButton recv,search,back,ok;
Connection con;
Register register=new Register();

Font f=new Font("TimesRoman", Font.BOLD, 25);
Font f1=new Font("TimesRoman", Font.BOLD, 18);
Font f2=new Font("TimesRoman", Font.PLAIN, 15);

public RepairPanel( ){
super();

search=new JButton("Search");search.setForeground(Color.white);
search.setFont(f1);search.setBackground(Color.BLUE);
back=new JButton("Main Menu");back.setForeground(Color.white);
back.setFont(f1);back.setBackground(Color.BLUE);
back.addActionListener(this);
ok=new JButton(" Ok ");ok.setForeground(Color.white);
ok.setFont(f1);ok.setBackground(Color.BLUE);

// Customer Detail Panel
cusDetail=new JLabel(" Customer Detail ");cusDetail.setForeground(Color.white);
cusName=new JLabel(" Name ");cusName.setForeground(Color.white);
cusMobileNo=new JLabel(" Mobile No. ");cusMobileNo.setForeground(Color.white);
cusAdress=new JLabel(" Adress ");cusAdress.setForeground(Color.white);
cusEmail=new JLabel(" Email ");cusEmail.setForeground(Color.white);
tName=new JTextField(25);
tMobileNo=new JTextField(25);
tEmail=new JTextField(25);
tAdress=new JTextArea();
tAdress.setPreferredSize(new Dimension(330, 80));
tAdress.setLineWrap(true);

cusDetail.setFont(f);
cusName.setFont(f1);cusMobileNo.setFont(f1);
cusAdress.setFont(f1);cusEmail.setFont(f1);
tName.setFont(f2);tMobileNo.setFont(f2);
tEmail.setFont(f2);tAdress.setFont(f2);

pf=new JPanel(new GridBagLayout());
GridBagConstraints c1= new GridBagConstraints();
c1.insets=new Insets(10,0,0,0);
c1.anchor=GridBagConstraints.LINE_START;
c1.gridx=0;c1.gridy=0;pf.add(cusDetail,c1);
c1.gridx=0;c1.gridy=1;pf.add(cusName,c1);
c1.gridx=1;c1.gridy=1;pf.add(tName,c1);
c1.gridx=0;c1.gridy=2;pf.add(cusMobileNo,c1);
c1.gridx=1;c1.gridy=2;pf.add(tMobileNo, c1);
c1.gridx=0;c1.gridy=3;pf.add(cusEmail,c1);
c1.gridx=1;c1.gridy=3;pf.add(tEmail,c1);
c1.gridx=0;c1.gridy=4;c1.anchor=GridBagConstraints.NORTHWEST;pf.add(cusAdress,c1);
c1.gridx=1;c1.gridy=4;pf.add(tAdress,c1);

// Mobile Detail Panel
pDetail=new JLabel(" Product Detail ");pDetail.setForeground(Color.white);
pName=new JLabel(" Name ");pName.setForeground(Color.white);
pImei=new JLabel(" IMEI ");pImei.setForeground(Color.white);
pModel=new JLabel(" Model ");pModel.setForeground(Color.white);
pType=new JLabel(" Type ");pType.setForeground(Color.white);
pMainFault=new JLabel(" Main Fault ");pMainFault.setForeground(Color.white);
pFaultDescription=new JLabel(" Fault Description ");pFaultDescription.setForeground(Color.white);
tpName=new JTextField(25);
tpModel=new JTextField(25);
tpImei=new JTextField(25);
tpFaultDetail=new JTextArea();tpFaultDetail.setPreferredSize(new Dimension(330, 80));
tpFaultDetail.setLineWrap(true);
tablet=new JRadioButton(" Tablet "); tablet.setBackground(Color.BLACK);
tablet.setForeground(Color.white); tablet.setFont(f1);
handset=new JRadioButton(" HandSet ");handset.setBackground(Color.BLACK);
handset.setForeground(Color.white); handset.setFont(f1);
pTypeGroup=new ButtonGroup();
pTypeGroup.add(tablet);pTypeGroup.add(handset);
recv=new JButton(" Receive ");recv.setForeground(Color.white);
recv.setBackground(Color.BLUE);recv.setFont(f1);

pDetail.setFont(f);
pName.setFont(f1);pImei.setFont(f1);
pModel.setFont(f1);pType.setFont(f1);
pMainFault.setFont(f1);pFaultDescription.setFont(f1);
tpName.setFont(f2);tpModel.setFont(f2);
tpImei.setFont(f2);tpFaultDetail.setFont(f2);

radioButtonPane=new JPanel();
radioButtonPane.add(tablet);radioButtonPane.add(handset);
radioButtonPane.setBackground(Color.BLACK);

c1.gridx=0;c1.gridy=5;pf.add(pDetail,c1);
c1.gridx=0;c1.gridy=6;pf.add(pName,c1);
c1.gridx=1;c1.gridy=6;pf.add(tpName,c1);
c1.gridx=0;c1.gridy=7;pf.add(pModel,c1);
c1.gridx=1;c1.gridy=7;pf.add(tpModel,c1);
c1.gridx=0;c1.gridy=8;pf.add(pImei,c1);
c1.gridx=1;c1.gridy=8;pf.add(tpImei,c1);
c1.gridx=0;c1.gridy=9;pf.add(pType, c1);
c1.gridx=1;c1.gridy=9;c1.anchor=GridBagConstraints.CENTER;pf.add(radioButtonPane, c1);
c1.gridx=0;c1.gridy=10;c1.anchor=GridBagConstraints.NORTHWEST;pf.add(pFaultDescription, c1);
c1.gridx=1;c1.gridy=10;pf.add(tpFaultDetail, c1);

buttonPane=new JPanel(new GridBagLayout());
GridBagConstraints c3= new GridBagConstraints();
c3.anchor=GridBagConstraints.LINE_START;
c3.insets=new Insets(0,10,0,0);
c3.gridx=0;c3.gridy=0;buttonPane.add(recv,c3);
c3.gridx=1;c3.gridy=0;buttonPane.add(ok,c3);
c3.gridx=2;c3.gridy=0;buttonPane.add(back,c3);
buttonPane.setBackground(Color.BLACK);

c1.gridx=1;c1.gridy=11;pf.add(buttonPane, c1);

search.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
//Step:-3) Statement SQL
String query=" Select* from RepairMobile where IMIE="+tpImei.getText();
try{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(query);

//Step:-4) Process Result
ResultSetMetaData md=rs.getMetaData();
int column=md.getColumnCount();
if(rs.next()){
tName.setText(rs.getObject("CustomerName").toString());
tMobileNo.setText(rs.getObject("MobileNo").toString());
tAdress.setText(rs.getObject("Adress").toString());
tEmail.setText(rs.getObject("Email").toString());
tpName.setText(rs.getObject("MobileName").toString());
tpImei.setText(rs.getObject("IMIE").toString());
tpModel.setText(rs.getObject("Model").toString());
tpFaultDetail.setText(rs.getObject("FaultDescription").toString());
String radioB_select=rs.getObject("Type").toString();
if(radioB_select.equals(" Tablet ")){tablet.setSelected(true);}
if(radioB_select.equals(" HandSet ")){handset.setSelected(true);}
}else{
JOptionPane.showMessageDialog(null,"Your Mobile is not Exits ");
}

//Step:-5) Connection and Result Process Close
rs.close();con.close();

}catch(SQLException e){
e.printStackTrace();
System.out.println("Qurey incorrect ");
}
}
});
ok.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
tName.setText("");
tMobileNo.setText("");
tEmail.setText("");
tAdress.setText("");
tpName.setText("");
tpModel.setText("");
tpImei.setText("");
tpFaultDetail.setText("");
pTypeGroup.clearSelection();
}
});

recv.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
if(tpImei.getText().equals("")){
JOptionPane.showMessageDialog(null, "Please Enter your IMEI");
}
else{
JFrame fr=new JFrame("Bill");
fr.setSize(600,600);
JButton ok;
JLabel problem,charg,servCharg,heading,imei,total;
JLabel dbproblem,dbcharg,dbservCharg,dbimei,dbtotal;
JPanel p;

ok=new JButton("Ok");ok.setForeground(Color.white);
ok.setFont(f1);ok.setBackground(Color.BLUE);
heading=new JLabel("Bill");heading.setFont(f);
charg=new JLabel("Charges");charg.setFont(f1);
servCharg=new JLabel("Service Charges");servCharg.setFont(f1);
problem=new JLabel("Faults Description");problem.setFont(f1);
imei=new JLabel("IMEI");imei.setFont(f1);
total=new JLabel("Total");total.setFont(f1);

dbcharg=new JLabel();dbcharg.setFont(f1);
dbservCharg=new JLabel();dbservCharg.setFont(f1);
dbproblem=new JLabel();dbproblem.setFont(f1);
dbimei=new JLabel();dbimei.setFont(f1);
dbtotal=new JLabel();dbtotal.setFont(f1);

heading.setForeground(Color.white);
charg.setForeground(Color.white);
servCharg.setForeground(Color.white);
problem.setForeground(Color.white);
imei.setForeground(Color.white);
total.setForeground(Color.white);

dbcharg.setForeground(Color.white);
dbservCharg.setForeground(Color.white);
dbproblem.setForeground(Color.white);
dbimei.setForeground(Color.white);
dbtotal.setForeground(Color.white);
//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
//Step:-3) Statement SQL
String query=" Select* from Bill where IMEI="+tpImei.getText();

try{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(query);

//Step:-4) Process Result
ResultSetMetaData md=rs.getMetaData();
int column=md.getColumnCount();

if(rs.next()){

dbimei.setText(rs.getObject("IMEI").toString());
dbcharg.setText(rs.getObject("Charges").toString());
dbproblem.setText(rs.getObject("FaultDescription").toString());
dbservCharg.setText(rs.getObject("ServiceCharges").toString());
Double t;
t=Double.parseDouble(rs.getObject("Charges").toString())+Double.parseDouble(rs.getObject("ServiceCharges").toString());
dbtotal.setText(""+t);
}else{
JOptionPane.showMessageDialog(null,"Your Mobile is not Exits ");
}

//Step:-5) Connection and Result Process Close
rs.close();con.close();

}catch(SQLException e){
e.printStackTrace();
System.out.println("Qurey incorrect ");
}

p=new JPanel(new GridBagLayout());
GridBagConstraints c4= new GridBagConstraints();
c4.insets=new Insets(30,30,0,0);
c4.anchor=GridBagConstraints.LINE_START;
c4.gridx=1;c4.gridy=0;p.add(heading,c4);
c4.anchor=GridBagConstraints.LINE_START;
c4.gridx=0;c4.gridy=1;p.add(imei,c4);
c4.gridx=1;c4.gridy=1;p.add(dbimei,c4);
c4.gridx=0;c4.gridy=2;c4.anchor=GridBagConstraints.NORTHWEST;p.add(problem,c4);
c4.anchor=GridBagConstraints.LINE_START;
c4.gridx=1;c4.gridy=2;p.add(dbproblem,c4);
c4.gridx=0;c4.gridy=3;p.add(charg,c4);
c4.gridx=1;c4.gridy=3;p.add(dbcharg,c4);
c4.gridx=0;c4.gridy=4;p.add(servCharg,c4);
c4.gridx=1;c4.gridy=4;p.add(dbservCharg,c4);
c4.gridx=0;c4.gridy=5;p.add(total,c4);
c4.gridx=1;c4.gridy=5;p.add(dbtotal,c4);
c4.gridx=1;c4.gridy=6;p.add(ok,c4);

p.setBackground(Color.BLACK);
fr.add(p);
fr.setVisible(true);

ok.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {

fr.setVisible(false);
JOptionPane.showMessageDialog(null, "Your Mobile is Recived ");

//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
// Step:-3) Statement SQL
String query="insert into Received(CustomerName,MobileNo,Email,Adress,MobileName,Model,IMIE,Type,FaultDescription)"+" values(?,?,?,?,?,?,?,?,?)";

//Step:-4) Insert Data
try {
PreparedStatement pst=con.prepareStatement(query);
pst.setString(1, tName.getText());
pst.setString(2, tMobileNo.getText());
pst.setString(3, tEmail.getText());
pst.setString(4,tAdress.getText());
pst.setString(5,tpName.getText());
pst.setString(6,tpModel.getText());
pst.setString(7,tpImei.getText());
String pType = "";
if(tablet.isSelected()){pType=tablet.getText();}
if(handset.isSelected()){pType=handset.getText();}
pst.setString(8, pType);
pst.setString(9,tpFaultDetail.getText());
pst.executeUpdate();

//Step:-5) Connection Close
con.close();
} catch (SQLException ex) {
System.out.println("Danish");
System.out.println(ex.getMessage());
}

try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
try{
Statement st=con.createStatement();
String sql = " delete from RepairMobile where IMIE = '"+tpImei.getText()+"' ";
st.executeUpdate(sql);

//Step:-5) Connection Close
con.close();
}catch(SQLException ex){
System.out.println(ex.getMessage());
System.out.println("Danish");
}
tName.setText("");
tMobileNo.setText("");
tEmail.setText("");
tAdress.setText("");
tpName.setText("");
tpModel.setText("");
tpImei.setText("");
tpFaultDetail.setText("");
pTypeGroup.clearSelection();
}
});
}}
});


pf.setBackground(Color.BLACK);
searchPane=new JPanel(new GridBagLayout());
GridBagConstraints c= new GridBagConstraints();
c.insets=new Insets(0,30,0,0);
c.gridx=0;c.gridy=0;searchPane.add(pImei,c);
c.gridx=1;c.gridy=0;searchPane.add(tpImei,c);
c.gridx=2;c.gridy=0;searchPane.add(search,c);
searchPane.setBackground(Color.BLACK);

this.setLayout(new GridBagLayout());
GridBagConstraints c2= new GridBagConstraints();
c2.insets=new Insets(20,0,0,0);
c2.gridx=0;c2.gridy=0;this.add(searchPane,c2);
c2.gridx=0;c2.gridy=1;this.add(pf,c2);
this.setBackground(Color.BLACK);
}

@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource().equals(back)){
this.removeAll();
this.repaint();
this.revalidate();

DashBoard d1=new DashBoard();

this.add(d1);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
}
}
public class RecivePanel extends JPanel implements ActionListener{
JPanel pf,searchPane;
JButton search;
JTextField tpImei;
JLabel plImei;
JButton back;

JLabel cusName,cusMobileNo,cusAdress,cusEmail,
pName,pImei,pModel,pType,pFaultDescription;

JLabel cusName_Db,cusMobileNo_Db,cusAdress_Db,cusEmail_Db,
pName_Db,pImei_Db,pModel_Db,pType_Db,pFaultDescription_Db;

JLabel problem,charg,servCharg,heading,imei,total;
JLabel dbproblem,dbcharg,dbservCharg,dbimei,dbtotal;

Connection con;

Font font=new Font("TimesRoman", Font.BOLD, 35);
Font f1=new Font("TimesRoman", Font.BOLD, 18);
Font f2=new Font("TimesRoman", Font.PLAIN, 18);
RecivePanel() throws SQLException{

back=new JButton("Main Menu");back.setForeground(Color.white);
back.setFont(f1);back.setBackground(Color.BLUE);
back.addActionListener(this);

tpImei=new JTextField(19);tpImei.setFont(f1);
search=new JButton("Search");search.setForeground(Color.white);
search.setFont(f1);search.setBackground(Color.BLUE);
plImei=new JLabel(" IMIE ");plImei.setFont(f1);plImei.setForeground(Color.WHITE);
cusName=new JLabel(" Customer Name ");cusName.setFont(f1);
cusMobileNo=new JLabel(" Mobile No. ");cusMobileNo.setFont(f1);
cusAdress=new JLabel(" Adress ");cusAdress.setFont(f1);
cusEmail=new JLabel(" Email ");cusEmail.setFont(f1);

cusName.setForeground(Color.white);
cusMobileNo.setForeground(Color.white);
cusAdress.setForeground(Color.white);
cusEmail.setForeground(Color.white);

pName=new JLabel(" Product Name ");pName.setFont(f1);
pImei=new JLabel(" IMIE ");pImei.setFont(f1);
pModel=new JLabel(" Model ");pModel.setFont(f1);
pType=new JLabel(" Type ");pType.setFont(f1);
pFaultDescription=new JLabel(" Fault Description");pFaultDescription.setFont(f1);

pName.setForeground(Color.white);
pImei.setForeground(Color.white);
pModel.setForeground(Color.white);
pType.setForeground(Color.white);
pFaultDescription.setForeground(Color.white);

cusName_Db=new JLabel();cusName_Db.setFont(f2);
cusMobileNo_Db=new JLabel();cusMobileNo_Db.setFont(f2);
cusAdress_Db=new JLabel();cusAdress_Db.setFont(f2);
cusEmail_Db=new JLabel();cusEmail_Db.setFont(f2);

cusName_Db.setForeground(Color.white);
cusMobileNo_Db.setForeground(Color.white);
cusAdress_Db.setForeground(Color.white);
cusEmail_Db.setForeground(Color.white);

pName_Db=new JLabel();pName_Db.setFont(f2);
pImei_Db=new JLabel();pImei_Db.setFont(f2);
pModel_Db=new JLabel();pModel_Db.setFont(f2);
pType_Db=new JLabel();pType_Db.setFont(f2);
pFaultDescription_Db=new JLabel();pFaultDescription_Db.setFont(f2);

pName_Db.setForeground(Color.white);
pImei_Db.setForeground(Color.white);
pModel_Db.setForeground(Color.white);
pType_Db.setForeground(Color.white);
pFaultDescription_Db.setForeground(Color.white);

heading=new JLabel(" Bill");heading.setFont(font);
charg=new JLabel("Charges");charg.setFont(f1);
servCharg=new JLabel("Service Charges");servCharg.setFont(f1);
problem=new JLabel("Faults Description");problem.setFont(f1);
imei=new JLabel("IMEI");imei.setFont(f1);
total=new JLabel("Total");total.setFont(f1);

dbcharg=new JLabel();dbcharg.setFont(f1);
dbservCharg=new JLabel();dbservCharg.setFont(f1);
dbproblem=new JLabel();dbproblem.setFont(f1);
dbimei=new JLabel();dbimei.setFont(f1);
dbtotal=new JLabel();dbtotal.setFont(f1);

heading.setForeground(Color.white);
charg.setForeground(Color.white);
servCharg.setForeground(Color.white);
problem.setForeground(Color.white);
imei.setForeground(Color.white);
total.setForeground(Color.white);

dbcharg.setForeground(Color.white);
dbservCharg.setForeground(Color.white);
dbproblem.setForeground(Color.white);
dbimei.setForeground(Color.white);
dbtotal.setForeground(Color.white);

pf=new JPanel();pf.setBackground(Color.BLACK);
pf.setLayout(new GridBagLayout());
GridBagConstraints c=new GridBagConstraints();
c.anchor=GridBagConstraints.LINE_START;
c.insets=new Insets(5,20,0,20);
c.gridx=0;c.gridy=0;pf.add(cusName,c);
c.gridx=1;c.gridy=0;pf.add(cusName_Db,c);
c.gridx=0;c.gridy=1;pf.add(cusMobileNo,c);
c.gridx=1;c.gridy=1;pf.add(cusMobileNo_Db,c);
c.gridx=0;c.gridy=2;pf.add(cusEmail,c);
c.gridx=1;c.gridy=2;pf.add(cusEmail_Db,c);
c.gridx=0;c.gridy=3;pf.add(cusAdress,c);
c.gridx=1;c.gridy=3;pf.add(cusAdress_Db,c);

c.gridx=0;c.gridy=4;pf.add(pName,c);
c.gridx=1;c.gridy=4;pf.add(pName_Db,c);
c.gridx=0;c.gridy=5;pf.add(pImei,c);
c.gridx=1;c.gridy=5;pf.add(pImei_Db,c);
c.gridx=0;c.gridy=6;pf.add(pModel,c);
c.gridx=1;c.gridy=6;pf.add(pModel_Db,c);
c.gridx=0;c.gridy=7;pf.add(pType,c);
c.gridx=1;c.gridy=7;pf.add(pType_Db,c);
c.gridx=0;c.gridy=8;pf.add(pFaultDescription,c);
c.gridx=1;c.gridy=8;pf.add(pFaultDescription_Db,c);

c.anchor=GridBagConstraints.LINE_START;
c.gridx=1;c.gridy=10;pf.add(heading,c);
c.gridx=0;c.gridy=11;pf.add(imei,c);
c.gridx=1;c.gridy=11;pf.add(dbimei,c);
c.gridx=0;c.gridy=12;c.anchor=GridBagConstraints.NORTHWEST;pf.add(problem,c);
c.anchor=GridBagConstraints.LINE_START;
c.gridx=1;c.gridy=12;pf.add(dbproblem,c);
c.gridx=0;c.gridy=13;pf.add(charg,c);
c.gridx=1;c.gridy=13;pf.add(dbcharg,c);
c.gridx=0;c.gridy=14;pf.add(servCharg,c);
c.gridx=1;c.gridy=14;pf.add(dbservCharg,c);
c.gridx=0;c.gridy=15;pf.add(total,c);
c.gridx=1;c.gridy=15;pf.add(dbtotal,c);

search.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}

//Step:-3) Statement SQL
String query=" Select* from Received where IMIE='"+tpImei.getText()+"' ";
String query2=" Select* from Bill where IMEI='"+tpImei.getText()+"' ";
try{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(query);

//Step:-4) Process Result
ResultSetMetaData md=rs.getMetaData();
int column=md.getColumnCount();

if(rs.next()){

cusName_Db.setText(rs.getObject("CustomerName").toString());
cusMobileNo_Db.setText(rs.getObject("MobileNo").toString());
cusAdress_Db.setText(rs.getObject("Adress").toString());
cusEmail_Db.setText(rs.getObject("Email").toString());

pName_Db.setText(rs.getObject("MobileName").toString());
pImei_Db.setText(rs.getObject("IMIE").toString());
pModel_Db.setText(rs.getObject("Model").toString());
pType_Db.setText(rs.getObject("Type").toString());
pFaultDescription_Db.setText(rs.getObject("FaultDescription").toString());

}else{
JOptionPane.showMessageDialog(null," Already Repaired or does not Exsists! ");
}

//Step:-5) Connection and Result Process Close
rs.close();con.close();

}catch(SQLException e){
e.printStackTrace();
System.out.println("Qurey incorrect ");
}

//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}
try{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(query2);

//Step:-4) Process Result
ResultSetMetaData md=rs.getMetaData();
int column=md.getColumnCount();

if(rs.next()){

dbimei.setText(rs.getObject("IMEI").toString());
dbcharg.setText(rs.getObject("Charges").toString());
dbproblem.setText(rs.getObject("FaultDescription").toString());
dbservCharg.setText(rs.getObject("ServiceCharges").toString());
Double t;
t=Double.parseDouble(rs.getObject("Charges").toString())+Double.parseDouble(rs.getObject("ServiceCharges").toString());
dbtotal.setText(""+t);
}else{
JOptionPane.showMessageDialog(null,"Your Mobile is not Exits ");
}

//Step:-5) Connection and Result Process Close
rs.close();con.close();

}catch(SQLException e){
e.printStackTrace();
System.out.println("Qurey incorrect ");
}
}

});

searchPane=new JPanel(new GridBagLayout());
GridBagConstraints c1= new GridBagConstraints();
c1.insets=new Insets(0,30,0,0);
c1.gridx=0;c1.gridy=0;searchPane.add(plImei,c1);
c1.gridx=1;c1.gridy=0;searchPane.add(tpImei,c1);
c1.gridx=2;c1.gridy=0;searchPane.add(search,c1);
searchPane.setBackground(Color.BLACK);

this.setLayout(new GridBagLayout());
GridBagConstraints c2= new GridBagConstraints();
c2.insets=new Insets(20,0,0,0);
c2.gridx=0;c2.gridy=0;this.add(searchPane,c2);
c2.gridx=0;c2.gridy=1;this.add(pf,c2);
c2.gridx=0;c2.gridy=2;this.add(back,c2);
this.setBackground(Color.BLACK);

}

@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource().equals(back)){
this.removeAll();
this.repaint();
this.revalidate();

DashBoard d1=new DashBoard();

this.add(d1);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
}
}

 

public class ReportPanel extends JPanel implements ActionListener {

JButton back;
JPanel UnRepairMobile,ScroolForPane;

JLabel cusName,cusMobileNo,cusAdress,cusEmail,
pName,pImei,pModel,pType,pFaultDescription;

JLabel cusName_Db,cusMobileNo_Db,cusAdress_Db,cusEmail_Db,
pName_Db,pImei_Db,pModel_Db,pType_Db,pFaultDescription_Db,endLine;

Connection con;

Font f1=new Font("TimesRoman", Font.BOLD, 18);
Font f2=new Font("TimesRoman", Font.PLAIN, 18);
ReportPanel() throws SQLException{

back=new JButton("Main Menu");back.setForeground(Color.white);
back.setFont(f1);back.setBackground(Color.BLUE);
back.addActionListener(this);

this.setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
this.setPreferredSize(new Dimension(765, 640));
ScroolForPane=new JPanel();
ScroolForPane.setLayout(new BoxLayout(ScroolForPane,BoxLayout.PAGE_AXIS));

//Step :- 1) Add the Drivers
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}catch(ClassNotFoundException e){
System.out.println(" Drivers not Found ");
}
//Step:-2) Established Connection Data Base
try{
con=DriverManager.getConnection
("jdbc:ucanaccess://C:\\Users\\Acer\\Desktop\\testing\\Mobile Reparing Project\\MobileRegister.accdb");
}catch(SQLException e){
System.out.println(" Data Base is Not Found ");
}

//Step:-3) Statement SQL
String query=" Select* from Report";
try{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(query);

//Step:-4) Process Result
ResultSetMetaData md=rs.getMetaData();
int column=md.getColumnCount();

while(rs.next()){
UnRepairMobile=new JPanel();
UnRepairMobile.setLayout(new GridBagLayout());
UnRepairMobile.setBackground(Color.WHITE);

cusName=new JLabel(" Customer Name ");cusName.setFont(f1);
cusMobileNo=new JLabel(" Mobile No. ");cusMobileNo.setFont(f1);
cusAdress=new JLabel(" Adress ");cusAdress.setFont(f1);
cusEmail=new JLabel(" Email ");cusEmail.setFont(f1);

pName=new JLabel(" Product Name ");pName.setFont(f1);
pImei=new JLabel(" IMIE ");pImei.setFont(f1);
pModel=new JLabel(" Model ");pModel.setFont(f1);
pType=new JLabel(" Type ");pType.setFont(f1);
pFaultDescription=new JLabel(" Fault Description");pFaultDescription.setFont(f1);
endLine=new JLabel(" ************** ");endLine.setFont(f1);

cusName_Db=new JLabel();cusName_Db.setFont(f2);
cusMobileNo_Db=new JLabel();cusMobileNo_Db.setFont(f2);
cusAdress_Db=new JLabel();cusAdress_Db.setFont(f2);
cusEmail_Db=new JLabel();cusEmail_Db.setFont(f2);

pName_Db=new JLabel();pName_Db.setFont(f2);
pImei_Db=new JLabel();pImei_Db.setFont(f2);
pModel_Db=new JLabel();pModel_Db.setFont(f2);
pType_Db=new JLabel();pType_Db.setFont(f2);
pFaultDescription_Db=new JLabel();pFaultDescription_Db.setFont(f2);

cusName_Db.setText(rs.getObject("CustomerName").toString());
cusMobileNo_Db.setText(rs.getObject("MobileNo").toString());
cusAdress_Db.setText(rs.getObject("Adress").toString());
cusEmail_Db.setText(rs.getObject("Email").toString());

pName_Db.setText(rs.getObject("MobileName").toString());
pImei_Db.setText(rs.getObject("IMIE").toString());
pModel_Db.setText(rs.getObject("Model").toString());
pType_Db.setText(rs.getObject("Type").toString());
pFaultDescription_Db.setText(rs.getObject("FaultDescription").toString());

GridBagConstraints c=new GridBagConstraints();
c.anchor=GridBagConstraints.LINE_START;
c.insets=new Insets(5,20,0,20);
c.gridx=0;c.gridy=0;UnRepairMobile.add(cusName,c);
c.gridx=1;c.gridy=0;UnRepairMobile.add(cusName_Db,c);
c.gridx=0;c.gridy=1;UnRepairMobile.add(cusMobileNo,c);
c.gridx=1;c.gridy=1;UnRepairMobile.add(cusMobileNo_Db,c);
c.gridx=0;c.gridy=2;UnRepairMobile.add(cusEmail,c);
c.gridx=1;c.gridy=2;UnRepairMobile.add(cusEmail_Db,c);
c.gridx=0;c.gridy=3;UnRepairMobile.add(cusAdress,c);
c.gridx=1;c.gridy=3;UnRepairMobile.add(cusAdress_Db,c);

c.gridx=0;c.gridy=4;UnRepairMobile.add(pName,c);
c.gridx=1;c.gridy=4;UnRepairMobile.add(pName_Db,c);
c.gridx=0;c.gridy=5;UnRepairMobile.add(pImei,c);
c.gridx=1;c.gridy=5;UnRepairMobile.add(pImei_Db,c);
c.gridx=0;c.gridy=6;UnRepairMobile.add(pModel,c);
c.gridx=1;c.gridy=6;UnRepairMobile.add(pModel_Db,c);
c.gridx=0;c.gridy=7;UnRepairMobile.add(pType,c);
c.gridx=1;c.gridy=7;UnRepairMobile.add(pType_Db,c);
c.gridx=0;c.gridy=8;UnRepairMobile.add(pFaultDescription,c);
c.gridx=1;c.gridy=8;UnRepairMobile.add(pFaultDescription_Db,c);

ScroolForPane.setBackground(Color.WHITE);
ScroolForPane.add(UnRepairMobile);
ScroolForPane.add(endLine);
}

//Step:-5) Connection and Result Process Close
rs.close();con.close();

}catch(SQLException e){
e.printStackTrace();
System.out.println("Qurey incorrect ");
}

JScrollPane scrollPane = new JScrollPane(ScroolForPane);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

this.add(scrollPane);
this.setBackground(Color.BLACK);
back.setAlignmentX(CENTER_ALIGNMENT);
this.add(back);
}

@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource().equals(back)){
this.removeAll();
this.repaint();
this.revalidate();

DashBoard d1=new DashBoard();

this.add(d1);
this.repaint();
this.revalidate();
this.setBackground(Color.BLACK);
}
}
}
Contact us - WSP Tech - World Solution Point Technologies

Contact Details for Java Projects

If you want any Project then contact our Customer support

Email: support@wsptech.pk

Mobile no: +92 304 5180559

 You can contact any time on Mobile Number.