0% found this document useful (0 votes)
52 views

Final

This document contains information about a final project submitted for an Object Oriented Programming class. The project is a management software for businesses. It includes the project title, submission details such as the student name and date, and UML diagrams and source code for the software. The source code uses Swing components to create a graphical user interface for login and main menu forms. It connects to an Access database for user authentication.

Uploaded by

noel portillo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Final

This document contains information about a final project submitted for an Object Oriented Programming class. The project is a management software for businesses. It includes the project title, submission details such as the student name and date, and UML diagrams and source code for the software. The source code uses Swing components to create a graphical user interface for login and main menu forms. It connects to an Access database for user authentication.

Uploaded by

noel portillo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 63

The University of Mindanao

Collage of Engineering Education

Management Software for Businesses


Final Project
In

Object Oriented Programming

Submitted to:
Engr. Darvin Taghoy
Professor: CpE 331/L

Submitted by:
Noel Arcenio Portillo

April 2, 2018
UML
Source Code:
ProjectF1.java icon = new JLabel();
package projectf1; icon.setIcon(new ImageIcon(path));
add(icon);
import java.awt.FlowLayout; add(lblUser);
import java.awt.event.ActionEvent; add(txtUser);
import java.awt.event.ActionListener; add(lblPass);
import javax.swing.*; add(txtPass);
import javax.swing.ImageIcon; add(btnLogin);
public class ProjectF1 extends JFrame { add(btnCancel);
private JButton btnLogin,btnCancel;
private JLabel lblUser,lblPass, icon;
private JTextField txtUser; btnLogin.addActionListener(new
ActionListener() {
private JPasswordField txtPass;
@Override
clsConnection connE = new
clsConnection(); public void
actionPerformed(ActionEvent e) {
public ProjectF1(){
initGUI();
connE.Search(txtUser.getText(),txtPass.g
} etText());

public void initGUI(){


String path =
"I:\\School\\ProjectF1\\Images\\logo.png";
}
});
setLayout(new FlowLayout());
btnCancel.addActionListener(new
btnLogin = new JButton("Login"); ActionListener() {

btnCancel= new JButton("Exit"); @Override

lblUser = new JLabel("Enter public void


Username:"); actionPerformed(ActionEvent e) {

lblPass = new JLabel("Enter System.exit(0);


Password:");
}
txtUser = new JTextField(16);
});
txtPass = new JPasswordField(16);
}
public static void main(String[] args) { gui.setTitle("Login Form");
ProjectF1 gui = new ProjectF1(); gui.show(true);
}
gui.setDefaultCloseOperation(JFrame.EXI
T_ON_CLOSE);
}
gui.setSize(350, 450);

dsconnection.java //String msAccessDBName =


"N:\\Final Project.accdb";
package projectf1;
//String strUrl =
"jdbc:odbc:Driver={Microsoft Access
Driver (*.mdb, *.accdb)};DBQ=" +
msAccessDBName +
import java.sql.*; ";DriverID=22;READONLY=true";

import javax.swing.JOptionPane; conn =


DriverManager.getConnection("jdbc:ucana
public class clsConnection { ccess://C:\\Users\\Noel
private String Portillo\\Desktop//Final Project.accdb");
strDriver="net.ucanaccess.jdbc.Ucanacce stmt = conn.createStatement();
ssDriver";
rs = stmt.executeQuery("Select
private Connection conn; First_Name, Password from Users where
public Statement stmt; First_Name='" + UserID + "' and
Password='" + Password + "'");
public ResultSet rs;
private String msAccessDBName =
"C:\\Users\\acer\\Desktop\\Final
Project.accdb"; if(rs.next()){
//private String
strUrl="jdbc:odbc:Driver={Microsoft JOptionPane.showMessageDialog(null,
Access Driver (*.mdb, *.accdb)};DBQ=" + "Welcome " + rs.getString("First_Name"));
msAccessDBName +
";DriverID=22;READONLY=true"; Main_Admin mn = new
Main_Admin();
private String user="root";
ProjectF1 gl = new ProjectF1();
private String pass="";
gl.setVisible(false);
mn.show();
public void Search(String UserID,String
Password) { }else{

JOptionPane.showMessageDialog(null,
try{ "Invalid Username or Password!");
Class.forName(strDriver); }
rs.close(); * This method is called from within the
constructor to initialize the form.
conn.close();
* WARNING: Do NOT modify this
}catch(Exception e){
code. The content of this method is
e.printStackTrace(); always

System.out.print(e.toString()); * regenerated by the Form Editor.

} */

} @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed"
desc="Generated Code">
void Search(String text) {
private void initComponents() {
throw new
UnsupportedOperationException("Not
supported yet."); //To change body of
jLabel2 = new javax.swing.JLabel();
generated methods, choose Tools |
Templates. jLabel1 = new javax.swing.JLabel();
} Main = new javax.swing.JButton();
} SalesOrder = new
javax.swing.JButton();
Main_Admin.java
Clients = new javax.swing.JButton();
Inventory = new
package projectf1; javax.swing.JButton();
jSeparator2 = new
javax.swing.JSeparator();
import java.awt.Desktop;
jSeparator1 = new
import java.net.URL; javax.swing.JSeparator();
import javax.swing.JFrame; Search = new
import javax.swing.JOptionPane; javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();

public class Main_Admin extends About = new javax.swing.JButton();


javax.swing.JFrame { jButton1 = new
javax.swing.JButton();

public Main_Admin() {
initComponents();
setDefaultCloseOperation(javax.swing.Wi
} ndowConstants.EXIT_ON_CLOSE);

/** jLabel2.setText("Main Page");


Main.setText("Main Page");
Main.setEnabled(false); Search.setText("Search");
Search.setCursor(new
java.awt.Cursor(java.awt.Cursor.TEXT_C
SalesOrder.setText("Sales Order");
URSOR));
SalesOrder.addActionListener(new
java.awt.event.ActionListener() {
jLabel3.setIcon(new
public void
javax.swing.ImageIcon(getClass().getRes
actionPerformed(java.awt.event.ActionEve
ource("/projectf1/logo.jpg"))); // NOI18N
nt evt) {

SalesOrderActionPerformed(evt); About.setText("About");
} About.addActionListener(new
java.awt.event.ActionListener() {
});
public void
actionPerformed(java.awt.event.ActionEve
Clients.setText("Clients"); nt evt) {

Clients.addActionListener(new AboutActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
});
actionPerformed(java.awt.event.ActionEve
nt evt) {
ClientsActionPerformed(evt); jButton1.setText("Website");
} jButton1.addActionListener(new
java.awt.event.ActionListener() {
});
public void
actionPerformed(java.awt.event.ActionEve
Inventory.setText("Inventory"); nt evt) {

Inventory.addActionListener(new jButton1ActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
});
actionPerformed(java.awt.event.ActionEve
nt evt) {
InventoryActionPerformed(evt); javax.swing.GroupLayout layout =
new
}
javax.swing.GroupLayout(getContentPane
}); ());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
jSeparator2.setOrientation(javax.swing.Sw
ingConstants.VERTICAL);
layout.createParallelGroup(javax.swing.Gr .addComponent(Inventory,
oupLayout.Alignment.LEADING) javax.swing.GroupLayout.DEFAULT_SIZE
,
javax.swing.GroupLayout.DEFAULT_SIZE
.addGroup(layout.createSequentialGroup(
, Short.MAX_VALUE)
)

.addComponent(Main,
.addGroup(layout.createParallelGroup(jav
javax.swing.GroupLayout.PREFERRED_
ax.swing.GroupLayout.Alignment.LEADIN
SIZE, 110,
G)
javax.swing.GroupLayout.PREFERRED_
SIZE)))
.addGroup(layout.createSequentialGroup(
)
.addGroup(layout.createSequentialGroup(
.addGap(23, 23, 23) )
.addContainerGap()
.addComponent(jSeparator1))
.addComponent(jLabel3)))
.addGroup(layout.createSequentialGroup(
)
.addPreferredGap(javax.swing.LayoutStyl
e.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
.addComponent(jSeparator2,
G)
javax.swing.GroupLayout.PREFERRED_
SIZE, 66,
.addGroup(layout.createSequentialGroup( javax.swing.GroupLayout.PREFERRED_
) SIZE)

.addGap(101, 101, .addGap(18, 18, 18)


101)
.addComponent(About)
.addGap(59, 59, 59)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN .addComponent(jButton1)
G, false)
.addPreferredGap(javax.swing.LayoutStyl
.addComponent(Clients, e.ComponentPlacement.RELATED, 745,
javax.swing.GroupLayout.DEFAULT_SIZE Short.MAX_VALUE)))
,
.addContainerGap())
javax.swing.GroupLayout.DEFAULT_SIZE
, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
.addComponent(SalesOrder,
G)
javax.swing.GroupLayout.DEFAULT_SIZE
,
javax.swing.GroupLayout.DEFAULT_SIZE
, Short.MAX_VALUE)
.addComponent(jSeparator1,
.addGroup(layout.createSequentialGroup( javax.swing.GroupLayout.PREFERRED_
) SIZE, 10,
javax.swing.GroupLayout.PREFERRED_
.addContainerGap()
SIZE)

.addGroup(layout.createParallelGroup(jav
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
ax.swing.GroupLayout.Alignment.LEADIN
G)
G)

.addGroup(javax.swing.GroupLayout.Align
.addGroup(layout.createSequentialGroup(
ment.TRAILING,
)
layout.createSequentialGroup()
.addGap(94, 94, 94)
.addPreferredGap(javax.swing.LayoutStyl
.addComponent(jLabel2) e.ComponentPlacement.RELATED)

.addPreferredGap(javax.swing.LayoutStyl .addGroup(layout.createParallelGroup(jav
e.ComponentPlacement.RELATED, 780, ax.swing.GroupLayout.Alignment.LEADIN
Short.MAX_VALUE) G)

.addComponent(Search,
javax.swing.GroupLayout.PREFERRED_ .addGroup(layout.createSequentialGroup(
SIZE, 171, )
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(jLabel3)
.addGap(250, 250, 250))
.addGap(18, 18, 18)
.addComponent(Main)
.addGroup(layout.createSequentialGroup(
) .addGap(18, 18, 18)
.addComponent(jLabel1)
.addComponent(SalesOrder)
.addContainerGap(javax.swing.GroupLay .addGap(18, 18, 18)
out.DEFAULT_SIZE,
Short.MAX_VALUE)))))
.addComponent(Clients)
);
.addGap(18, 18, 18)
layout.setVerticalGroup(
.addComponent(Inventory)
layout.createParallelGroup(javax.swing.Gr
.addGap(0, 322,
oupLayout.Alignment.LEADING)
Short.MAX_VALUE))

.addGroup(layout.createSequentialGroup(
.addComponent(jSeparator2,
)
javax.swing.GroupLayout.DEFAULT_SIZE
.addGap(53, 53, 53) , 685, Short.MAX_VALUE))
.addContainerGap()) javax.swing.GroupLayout.PREFERRED_
SIZE)
.addGroup(layout.createSequentialGroup(
) .addComponent(jLabel2)))
.addGap(216, 216, 216) .addGap(35, 35, 35)
.addComponent(jLabel1)
.addGroup(layout.createParallelGroup(jav
.addContainerGap(698,
ax.swing.GroupLayout.Alignment.BASELI
Short.MAX_VALUE)))
NE)
);
.addComponent(About)

.addComponent(jButton1)) pack();
}// </editor-fold>
.addContainerGap(javax.swing.GroupLay
out.DEFAULT_SIZE,
Short.MAX_VALUE)))) private void
SalesOrderActionPerformed(java.awt.eve
.addGroup(layout.createParallelGroup(jav nt.ActionEvent evt) {
ax.swing.GroupLayout.Alignment.LEADIN JFrame frame = new
G) JFrame("JOptionPane
showMessageDialog example");
.addGroup(layout.createSequentialGroup(
) JOptionPane.showMessageDialog(frame,
.addGap(13, 13, 13) "Feature comming soon!!");
}
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
G) private void
ClientsActionPerformed(java.awt.event.Ac
.addComponent(Search, tionEvent evt) {
javax.swing.GroupLayout.PREFERRED_
SIZE, this.setVisible(false);
javax.swing.GroupLayout.DEFAULT_SIZE
new Clients().setVisible(true);
,
javax.swing.GroupLayout.PREFERRED_ }
SIZE)

.addGroup(javax.swing.GroupLayout.Align private void


ment.TRAILING, AboutActionPerformed(java.awt.event.Acti
layout.createSequentialGroup() onEvent evt) {
this.setVisible(false);
.addPreferredGap(javax.swing.LayoutStyl new About().setVisible(true);
e.ComponentPlacement.RELATED, 6,
}
for
(javax.swing.UIManager.LookAndFeelInfo
private void
info :
jButton1ActionPerformed(java.awt.event.A
javax.swing.UIManager.getInstalledLookA
ctionEvent evt) {
ndFeels()) {
try {
if
Desktop.getDesktop().browse(new ("Nimbus".equals(info.getName())) {
URL("http://www.dentaldomain.ph/").toURI
());
javax.swing.UIManager.setLookAndFeel(i
} catch (Exception e) { nfo.getClassName());

e.printStackTrace(); break;

} }

} }
} catch (ClassNotFoundException ex)
{
private void
InventoryActionPerformed(java.awt.event.
ActionEvent evt) { java.util.logging.Logger.getLogger(Main_A
dmin.class.getName()).log(java.util.loggin
this.setVisible(false); g.Level.SEVERE, null, ex);
new Inventory().setVisible(true); } catch (InstantiationException ex) {
}
java.util.logging.Logger.getLogger(Main_A
dmin.class.getName()).log(java.util.loggin
/** g.Level.SEVERE, null, ex);
* @param args the command line } catch (IllegalAccessException ex) {
arguments
*/ java.util.logging.Logger.getLogger(Main_A
dmin.class.getName()).log(java.util.loggin
public static void main(String args[]) {
g.Level.SEVERE, null, ex);
System.out.print("hi");
} catch
//<editor-fold defaultstate="collapsed" (javax.swing.UnsupportedLookAndFeelEx
desc=" Look and feel setting code ception ex) {
(optional) ">
/* If Nimbus (introduced in Java SE java.util.logging.Logger.getLogger(Main_A
6) is not available, stay with the default dmin.class.getName()).log(java.util.loggin
look and feel. g.Level.SEVERE, null, ex);

* For details see }


http://download.oracle.com/javase/tutorial/
//</editor-fold>
uiswing/lookandfeel/plaf.html
*/
/* Create and display the form */
try {
import java.sql.Statement;
java.awt.EventQueue.invokeLater(new
import javax.swing.JFrame;
Runnable() {
import javax.swing.JOptionPane;
public void run() {
import net.proteanit.sql.DbUtils;
new
Main_Admin().setVisible(true);
}
}); public class Clients extends
javax.swing.JFrame {
}

Connection cn = null;
// Variables declaration - do not modify
ResultSet rs = null;
private javax.swing.JButton About;
Statement s = null;
private javax.swing.JButton Clients;
Search_Clients connE = new
private javax.swing.JButton Inventory;
Search_Clients();
private javax.swing.JButton Main;
public Clients() {
private javax.swing.JButton SalesOrder;
initComponents();
private javax.swing.JTextField Search;
}
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
@SuppressWarnings("unchecked")
private javax.swing.JLabel jLabel3;
// <editor-fold defaultstate="collapsed"
private javax.swing.JSeparator desc="Generated Code">
jSeparator1;
private void initComponents() {
private javax.swing.JSeparator
jSeparator2;
jLabel2 = new javax.swing.JLabel();
// End of variables declaration
jLabel1 = new javax.swing.JLabel();
}
Main = new javax.swing.JButton();
Clients.java
SalesOrder = new
package projectf1; javax.swing.JButton();
Clients = new javax.swing.JButton();
import java.sql.Connection; Inventory = new
javax.swing.JButton();
import java.sql.DriverManager;
jSeparator2 = new
import java.sql.PreparedStatement;
javax.swing.JSeparator();
import java.sql.ResultSet;
jSeparator1 = new });
javax.swing.JSeparator();
Create = new javax.swing.JButton();
SalesOrder.setText("Sales Order");
jScrollPane1 = new
SalesOrder.addActionListener(new
javax.swing.JScrollPane();
java.awt.event.ActionListener() {
Clientable = new
public void
javax.swing.JTable();
actionPerformed(java.awt.event.ActionEve
Edit = new javax.swing.JButton(); nt evt) {
jLabel3 = new javax.swing.JLabel();
SalesOrderActionPerformed(evt);
jLabel4 = new javax.swing.JLabel();
}
jLabel5 = new javax.swing.JLabel();
});
Search2 = new
javax.swing.JTextField();
Go_Clients = new Clients.setText("Clients");
javax.swing.JButton();
Clients.setEnabled(false);
Edit_Client = new
Clients.addActionListener(new
javax.swing.JButton();
java.awt.event.ActionListener() {
Delete = new javax.swing.JButton();
public void
actionPerformed(java.awt.event.ActionEve
nt evt) {
setDefaultCloseOperation(javax.swing.Wi ClientsActionPerformed(evt);
ndowConstants.EXIT_ON_CLOSE);
}
setTitle("Clients");
});

jLabel2.setFont(new
Inventory.setText("Inventory");
java.awt.Font("Tahoma", 1, 14)); //
NOI18N Inventory.addActionListener(new
java.awt.event.ActionListener() {
jLabel2.setText("Clients");
public void
actionPerformed(java.awt.event.ActionEve
Main.setText("Main Page"); nt evt) {
Main.addActionListener(new InventoryActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
});
actionPerformed(java.awt.event.ActionEve
nt evt) {
MainActionPerformed(evt);
jSeparator2.setOrientation(javax.swing.Sw
}
ingConstants.VERTICAL);
jLabel4.setIcon(new
javax.swing.ImageIcon(getClass().getRes
Create.setText("Create");
ource("/projectf1/logo.jpg"))); // NOI18N
Create.addActionListener(new
java.awt.event.ActionListener() {
jLabel5.setText("Search Clients: ");
public void
actionPerformed(java.awt.event.ActionEve
nt evt) {
Search2.addActionListener(new
CreateActionPerformed(evt); java.awt.event.ActionListener() {
} public void
actionPerformed(java.awt.event.ActionEve
});
nt evt) {
Search2ActionPerformed(evt);
Clientable.setModel(new
}
javax.swing.table.DefaultTableModel(
});
new Object [][] {

Go_Clients.setText("Go");
},
Go_Clients.addActionListener(new
new String [] {
java.awt.event.ActionListener() {
"Account Number", "Client
public void
Name", "Address", "Phone Number",
actionPerformed(java.awt.event.ActionEve
"Email Adress"
nt evt) {
}
)); Go_ClientsActionPerformed(evt);
}
jScrollPane1.setViewportView(Clientable);
});

Edit.setText("Refresh");
Edit_Client.setText("Edit");
Edit.addActionListener(new
Edit_Client.addActionListener(new
java.awt.event.ActionListener() {
java.awt.event.ActionListener() {
public void
public void
actionPerformed(java.awt.event.ActionEve
actionPerformed(java.awt.event.ActionEve
nt evt) {
nt evt) {
EditActionPerformed(evt);
} Edit_ClientActionPerformed(evt);

}); }
});
Delete.setText("Delete");
.addGroup(layout.createSequentialGroup(
Delete.addActionListener(new
)
java.awt.event.ActionListener() {
.addGap(46, 46, 46)
public void
actionPerformed(java.awt.event.ActionEve
nt evt) { .addComponent(jLabel3))
DeleteActionPerformed(evt);
.addGroup(layout.createSequentialGroup(
}
)
});
.addContainerGap()

javax.swing.GroupLayout layout = .addComponent(jLabel4))


new
javax.swing.GroupLayout(getContentPane
.addGroup(layout.createSequentialGroup(
());
)
getContentPane().setLayout(layout);
.addGap(106, 106,
layout.setHorizontalGroup( 106)

layout.createParallelGroup(javax.swing.Gr .addGroup(layout.createParallelGroup(jav
oupLayout.Alignment.LEADING) ax.swing.GroupLayout.Alignment.LEADIN
G, false)

.addGroup(layout.createSequentialGroup(
) .addComponent(Clients,
javax.swing.GroupLayout.DEFAULT_SIZE
,
.addGroup(layout.createParallelGroup(jav javax.swing.GroupLayout.DEFAULT_SIZE
ax.swing.GroupLayout.Alignment.LEADIN , Short.MAX_VALUE)
G)

.addComponent(SalesOrder,
.addGroup(javax.swing.GroupLayout.Align javax.swing.GroupLayout.DEFAULT_SIZE
ment.TRAILING, ,
layout.createSequentialGroup() javax.swing.GroupLayout.DEFAULT_SIZE
.addContainerGap() , Short.MAX_VALUE)

.addComponent(jSeparator1)) .addComponent(Inventory,
javax.swing.GroupLayout.DEFAULT_SIZE
,
.addGroup(layout.createSequentialGroup( javax.swing.GroupLayout.DEFAULT_SIZE
) , Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(jav .addComponent(Main,
ax.swing.GroupLayout.Alignment.LEADIN javax.swing.GroupLayout.PREFERRED_
G) SIZE, 110,
javax.swing.GroupLayout.PREFERRED_ .addGap(18, 18, 18)
SIZE))))
.addComponent(Delete,
.addPreferredGap(javax.swing.LayoutStyl javax.swing.GroupLayout.PREFERRED_
e.ComponentPlacement.UNRELATED) SIZE, 80,
javax.swing.GroupLayout.PREFERRED_
SIZE)))
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_ .addGap(0, 120,
SIZE, 66, Short.MAX_VALUE)))
javax.swing.GroupLayout.PREFERRED_
.addContainerGap())
SIZE)
.addGap(185, 185, 185)
.addGroup(javax.swing.GroupLayout.Align
ment.TRAILING,
.addGroup(layout.createParallelGroup(jav layout.createSequentialGroup()
ax.swing.GroupLayout.Alignment.LEADIN
.addGap(0, 0,
G)
Short.MAX_VALUE)
.addComponent(jLabel5)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_
SIZE, 647, .addPreferredGap(javax.swing.LayoutStyl
javax.swing.GroupLayout.PREFERRED_ e.ComponentPlacement.RELATED)
SIZE)
.addComponent(Search2,
javax.swing.GroupLayout.PREFERRED_
.addGroup(layout.createSequentialGroup( SIZE, 130,
) javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(Create, .addGap(18, 18, 18)
javax.swing.GroupLayout.PREFERRED_
SIZE, 83, .addComponent(Go_Clients)
javax.swing.GroupLayout.PREFERRED_ .addGap(138, 138, 138))
SIZE)
.addGap(18, 18, 18) .addGroup(layout.createParallelGroup(jav
.addComponent(Edit, ax.swing.GroupLayout.Alignment.LEADIN
javax.swing.GroupLayout.PREFERRED_ G)
SIZE, 84,
javax.swing.GroupLayout.PREFERRED_ .addGroup(javax.swing.GroupLayout.Align
SIZE) ment.TRAILING,
.addGap(18, 18, 18) layout.createSequentialGroup()
.addGap(104, 104, 104)
.addComponent(Edit_Client, .addComponent(jLabel2)
javax.swing.GroupLayout.PREFERRED_
SIZE, 70, .addGap(1216, 1216, 1216))
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addGroup(layout.createSequentialGroup( .addGroup(layout.createParallelGroup(jav
) ax.swing.GroupLayout.Alignment.LEADIN
G)
.addGap(10, 10, 10)
.addComponent(jLabel1)
.addGroup(layout.createSequentialGroup(
.addContainerGap(1367, )
Short.MAX_VALUE)))
); .addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
layout.setVerticalGroup( NE)
.addComponent(Create)
layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING) .addComponent(Edit)
.addComponent(jLabel3)
.addGroup(layout.createSequentialGroup(
)
.addComponent(Edit_Client)
.addGap(14, 14, 14)
.addComponent(Delete))

.addGroup(layout.createParallelGroup(jav
.addPreferredGap(javax.swing.LayoutStyl
ax.swing.GroupLayout.Alignment.BASELI
e.ComponentPlacement.RELATED)
NE)
.addComponent(jLabel5)
.addGroup(layout.createParallelGroup(jav
.addComponent(Search2, ax.swing.GroupLayout.Alignment.LEADIN
javax.swing.GroupLayout.PREFERRED_ G)
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
.addComponent(jScrollPane1,
,
javax.swing.GroupLayout.PREFERRED_
javax.swing.GroupLayout.PREFERRED_
SIZE,
SIZE)
javax.swing.GroupLayout.DEFAULT_SIZE
.addComponent(Go_Clients)) ,
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addPreferredGap(javax.swing.LayoutStyl
e.ComponentPlacement.RELATED)
.addGroup(layout.createSequentialGroup(
.addComponent(jSeparator1, )
javax.swing.GroupLayout.PREFERRED_
SIZE, 10,
javax.swing.GroupLayout.PREFERRED_ .addComponent(jLabel4)
SIZE)
.addGap(38, 38, 38)
.addComponent(Main)
.addPreferredGap(javax.swing.LayoutStyl
e.ComponentPlacement.RELATED) .addGap(18, 18, 18)
// TODO add your handling code
.addComponent(SalesOrder) here:
.addGap(18, 18, 18) }

.addComponent(Clients)
private void
.addGap(18, 18, 18) MainActionPerformed(java.awt.event.Actio
nEvent evt) {
.addComponent(Inventory))) this.setVisible(false);
.addGap(0, 0, new Main_Admin().setVisible(true);
Short.MAX_VALUE))
}
.addComponent(jSeparator2,
javax.swing.GroupLayout.Alignment.TRAI
LING, private void
javax.swing.GroupLayout.DEFAULT_SIZE SalesOrderActionPerformed(java.awt.eve
, 696, Short.MAX_VALUE)) nt.ActionEvent evt) {
.addContainerGap()) JFrame frame = new
JFrame("JOptionPane
showMessageDialog example");
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
G) JOptionPane.showMessageDialog(frame,
"Feature comming soon!!");
.addGroup(layout.createSequentialGroup( }
)
.addGap(16, 16, 16)
private void
.addComponent(jLabel2) InventoryActionPerformed(java.awt.event.
ActionEvent evt) {
.addGap(34, 34, 34)
this.setVisible(false);
.addComponent(jLabel1)
new Inventory().setVisible(true);
.addContainerGap(702,
Short.MAX_VALUE))) }
);

private void
CreateActionPerformed(java.awt.event.Ac
pack();
tionEvent evt) {
}// </editor-fold>
this.setVisible(false);
new
private void New_ClientGUI().setVisible(true);
ClientsActionPerformed(java.awt.event.Ac
}
tionEvent evt) {
private void }
EditActionPerformed(java.awt.event.Actio
nEvent evt) {
private void
try {
DeleteActionPerformed(java.awt.event.Act
Connection ionEvent evt) {
conn=DriverManager.getConnection("jdbc
String Input =
:ucanaccess://C:\\Users\\Noel
JOptionPane.showInputDialog("Enter
Portillo\\Desktop\\Final Project.accdb");
Control Number: ");
String sql="select
try {
Account_Number,Client_Name,Address,P
hone_Number,Email_Address from
Clients"; Class.forName("net.ucanaccess.jdbc.Uca
naccessDriver");
PreparedStatement
pst=conn.prepareStatement(sql); cn =
DriverManager.getConnection("jdbc:ucana
ResultSet
ccess://C:\\Users\\Noel
rs=pst.executeQuery();
Portillo\\Desktop//Final Project.accdb");
String sql = "Delete from Clients
Clientable.setModel(DbUtils.resultSetToT
where Account_Number = '"+Input+"' ";
ableModel(rs));
s = cn.createStatement();
}
s.executeUpdate(sql);
catch(Exception ex)
{

JOptionPane.showMessageDialog(null, }
ex);
catch (Exception ex) {
}
} JOptionPane.showMessageDialog(null,
ex);
}
private void
Search2ActionPerformed(java.awt.event.A }
ctionEvent evt) {
// TODO add your handling code
here: private void
Edit_ClientActionPerformed(java.awt.even
} t.ActionEvent evt) {
this.setVisible(false);
private void new Edit_ClientGUI().setVisible(true);
Go_ClientsActionPerformed(java.awt.even
t.ActionEvent evt) { }

connE.Search_Clients(Search2.getText());
/** class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
* @param args the command line
arguments } catch (IllegalAccessException ex) {
*/
java.util.logging.Logger.getLogger(Clients.
public static void main(String args[]) {
class.getName()).log(java.util.logging.Lev
System.out.print("hi"); el.SEVERE, null, ex);

//<editor-fold defaultstate="collapsed" } catch


desc=" Look and feel setting code (javax.swing.UnsupportedLookAndFeelEx
(optional) "> ception ex) {

/* If Nimbus (introduced in Java SE


6) is not available, stay with the default java.util.logging.Logger.getLogger(Clients.
look and feel. class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
* For details see
http://download.oracle.com/javase/tutorial/ }
uiswing/lookandfeel/plaf.html
//</editor-fold>
*/
try {
/* Create and display the form */
for
(javax.swing.UIManager.LookAndFeelInfo
java.awt.EventQueue.invokeLater(new
info :
Runnable() {
javax.swing.UIManager.getInstalledLookA
ndFeels()) { public void run() {
if new Clients().setVisible(true);
("Nimbus".equals(info.getName())) {
}
});
javax.swing.UIManager.setLookAndFeel(i
nfo.getClassName()); }
break;
} // Variables declaration - do not modify
} private javax.swing.JTable Clientable;
} catch (ClassNotFoundException ex) private javax.swing.JButton Clients;
{
private javax.swing.JButton Create;

java.util.logging.Logger.getLogger(Clients. private javax.swing.JButton Delete;


class.getName()).log(java.util.logging.Lev private javax.swing.JButton Edit;
el.SEVERE, null, ex);
private javax.swing.JButton Edit_Client;
} catch (InstantiationException ex) {
private javax.swing.JButton Go_Clients;

java.util.logging.Logger.getLogger(Clients. private javax.swing.JButton Inventory;


private javax.swing.JButton Main; public New_ClientGUI() {
private javax.swing.JButton SalesOrder; initComponents();
private javax.swing.JTextField Search2; }
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3; @SuppressWarnings("unchecked")
private javax.swing.JLabel jLabel4; // <editor-fold defaultstate="collapsed"
desc="Generated Code">
private javax.swing.JLabel jLabel5;
private void initComponents() {
private javax.swing.JScrollPane
jScrollPane1;
private javax.swing.JSeparator jLabel4 = new javax.swing.JLabel();
jSeparator1;
jLabel1 = new javax.swing.JLabel();
private javax.swing.JSeparator
Account = new
jSeparator2;
javax.swing.JTextField();
// End of variables declaration
jLabel2 = new javax.swing.JLabel();
}
Name = new
New_ClientGUI.java javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
package projectf1;
Address = new
javax.swing.JTextField();
import java.sql.Connection;
Submit = new javax.swing.JButton();
import java.sql.DriverManager;
Cancel = new javax.swing.JButton();
import java.sql.ResultSet;
jLabel5 = new javax.swing.JLabel();
import java.sql.Statement;
Phone = new
import javax.swing.JOptionPane; javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
Email = new
javax.swing.JTextField();
public class New_ClientGUI extends
javax.swing.JFrame {

setDefaultCloseOperation(javax.swing.Wi
Connection cn = null; ndowConstants.EXIT_ON_CLOSE);
ResultSet rs = null; setTitle("New Client");
Statement s = null;
jLabel4.setFont(new javax.swing.GroupLayout layout =
java.awt.Font("Tahoma", 1, 36)); // new
NOI18N javax.swing.GroupLayout(getContentPane
());
jLabel4.setText("NEW CLIENT");
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
jLabel1.setText("Account Number:");

layout.createParallelGroup(javax.swing.Gr
jLabel2.setText("Full Name:"); oupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup(
jLabel3.setText("Address:"); )

Submit.setText("Submit"); .addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.TRAILIN
Submit.addActionListener(new G)
java.awt.event.ActionListener() {
.addComponent(jLabel4,
public void javax.swing.GroupLayout.PREFERRED_
actionPerformed(java.awt.event.ActionEve SIZE, 242,
nt evt) { javax.swing.GroupLayout.PREFERRED_
SIZE)
SubmitActionPerformed(evt);
}
.addGroup(layout.createParallelGroup(jav
}); ax.swing.GroupLayout.Alignment.LEADIN
G)

Cancel.setText("Cancel"); .addGroup(layout.createSequentialGroup(
Cancel.addActionListener(new )
java.awt.event.ActionListener() { .addGap(119, 119, 119)
public void
actionPerformed(java.awt.event.ActionEve .addComponent(Submit))
nt evt) {
CancelActionPerformed(evt); .addGroup(layout.createSequentialGroup(
} )

}); .addGap(100, 100, 100)

.addGroup(layout.createParallelGroup(jav
jLabel5.setText("Phone Number:"); ax.swing.GroupLayout.Alignment.TRAILIN
G)

jLabel6.setText("Email Address:");
.addComponent(Cancel)
.addGroup(layout.createSequentialGroup( layout.createParallelGroup(javax.swing.Gr
) oupLayout.Alignment.LEADING)

.addGroup(layout.createParallelGroup(jav .addGroup(javax.swing.GroupLayout.Align
ax.swing.GroupLayout.Alignment.TRAILIN ment.TRAILING,
G) layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel3)
.addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_
.addComponent(jLabel2) SIZE, 73,
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jLabel5)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
.addComponent(jLabel6))
NE)
.addGap(18, 18,
.addComponent(jLabel1)
18)
.addComponent(Account,
javax.swing.GroupLayout.PREFERRED_
.addGroup(layout.createParallelGroup(jav
SIZE,
ax.swing.GroupLayout.Alignment.LEADIN
javax.swing.GroupLayout.DEFAULT_SIZE
G, false)
,
javax.swing.GroupLayout.PREFERRED_
.addComponent(Name) SIZE))
.addGap(18, 18, 18)
.addComponent(Address,
javax.swing.GroupLayout.DEFAULT_SIZE
.addGroup(layout.createParallelGroup(jav
, 111, Short.MAX_VALUE)
ax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(Account)
.addComponent(jLabel2)
.addComponent(Name,
.addComponent(Phone)
javax.swing.GroupLayout.PREFERRED_
SIZE,
.addComponent(Email))))))) javax.swing.GroupLayout.DEFAULT_SIZE
,
.addContainerGap(88, javax.swing.GroupLayout.PREFERRED_
Short.MAX_VALUE)) SIZE))
); .addGap(18, 18, 18)
layout.setVerticalGroup(
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN .addComponent(Submit)
G)
.addComponent(Cancel))
.addComponent(jLabel3)
.addGap(51, 51, 51))
.addComponent(Address,
);
javax.swing.GroupLayout.PREFERRED_
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
, pack();
javax.swing.GroupLayout.PREFERRED_ }// </editor-fold>
SIZE))
.addGap(20, 20, 20)
private void
SubmitActionPerformed(java.awt.event.Ac
.addGroup(layout.createParallelGroup(jav tionEvent evt) {
ax.swing.GroupLayout.Alignment.BASELI
NE) try {

.addComponent(jLabel5)
.addComponent(Phone, String str = Name.getText();
javax.swing.GroupLayout.PREFERRED_
String str1 = Address.getText();
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE String str2 = Phone.getText();
,
javax.swing.GroupLayout.PREFERRED_ String str3 = Email.getText();
SIZE)) String str4 = Account.getText();
.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(jav Class.forName("net.ucanaccess.jdbc.Uca
ax.swing.GroupLayout.Alignment.BASELI naccessDriver");
NE)
Connection cn =
.addComponent(Email, DriverManager.getConnection("jdbc:ucana
javax.swing.GroupLayout.PREFERRED_ ccess://C:\\Users\\Noel
SIZE, Portillo\\Desktop\\Final Project.accdb");
javax.swing.GroupLayout.DEFAULT_SIZE
, String sql = "insert into Clients
javax.swing.GroupLayout.PREFERRED_ (Account_Number, Client_Name,
SIZE) Address, Phone_Number, Email_Address)
values ('"+str4+"', '"+str+"', '"+str1+"',
.addComponent(jLabel6)) '"+str2+"', '"+str3+"')";
s = cn.createStatement();
.addPreferredGap(javax.swing.LayoutStyl
e.ComponentPlacement.RELATED, 33, s.executeUpdate(sql);
Short.MAX_VALUE)

} catch (Exception ex) {


.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
NE)
info :
JOptionPane.showMessageDialog(null, javax.swing.UIManager.getInstalledLookA
ex); ndFeels()) {
} if
("Nimbus".equals(info.getName())) {
setVisible(false);
New_ClientGUI form = new
javax.swing.UIManager.setLookAndFeel(i
New_ClientGUI();
nfo.getClassName());
form.setVisible(false);
break;
new Clients().setVisible(true);
}
}
}
} catch (ClassNotFoundException ex)
private void {
CancelActionPerformed(java.awt.event.Ac
tionEvent evt) {
java.util.logging.Logger.getLogger(New_C
this.setVisible(false); lientGUI.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
new Clients().setVisible(true);
} catch (InstantiationException ex) {
}

java.util.logging.Logger.getLogger(New_C
/** lientGUI.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
* @param args the command line
arguments } catch (IllegalAccessException ex) {

*/
java.util.logging.Logger.getLogger(New_C
public static void main(String args[]) { lientGUI.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
/* Set the Nimbus look and feel */
} catch
//<editor-fold defaultstate="collapsed"
(javax.swing.UnsupportedLookAndFeelEx
desc=" Look and feel setting code
ception ex) {
(optional) ">
/* If Nimbus (introduced in Java SE
java.util.logging.Logger.getLogger(New_C
6) is not available, stay with the default
lientGUI.class.getName()).log(java.util.log
look and feel.
ging.Level.SEVERE, null, ex);
* For details see
}
http://download.oracle.com/javase/tutorial/
uiswing/lookandfeel/plaf.html //</editor-fold>
*/
try { /* Create and display the form */
for
(javax.swing.UIManager.LookAndFeelInfo
import java.sql.Statement;
java.awt.EventQueue.invokeLater(new
Runnable() {
public void run() {
public class Edit_ClientGUI extends
new
javax.swing.JFrame {
New_ClientGUI().setVisible(true);
}
Connection cn = null;
});
ResultSet rs = null;
}
Statement state = null;

// Variables declaration - do not modify


public Edit_ClientGUI() {
private javax.swing.JTextField Account;
initComponents();
private javax.swing.JTextField Address;
}
private javax.swing.JButton Cancel;
private javax.swing.JTextField Email;
private javax.swing.JTextField Name;
@SuppressWarnings("unchecked")
private javax.swing.JTextField Phone;
// <editor-fold defaultstate="collapsed"
private javax.swing.JButton Submit;
desc="Generated Code">
private javax.swing.JLabel jLabel1;
private void initComponents() {
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
Cancel = new javax.swing.JButton();
private javax.swing.JLabel jLabel4;
Submit = new javax.swing.JButton();
private javax.swing.JLabel jLabel5;
Email = new
private javax.swing.JLabel jLabel6; javax.swing.JTextField();
// End of variables declaration jLabel6 = new javax.swing.JLabel();
} jLabel5 = new javax.swing.JLabel();
Phone = new
javax.swing.JTextField();
Edit_Client.java
Address = new
package projectf1; javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();

import java.sql.Connection; Name = new


javax.swing.JTextField();
import java.sql.DriverManager;
jLabel2 = new javax.swing.JLabel();
import java.sql.ResultSet;
jLabel1 = new javax.swing.JLabel();
Account = new jLabel2.setText("Full Name:");
javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel1.setText("Account Number:");

jLabel4.setFont(new
setDefaultCloseOperation(javax.swing.Wi
java.awt.Font("Tahoma", 1, 36)); //
ndowConstants.EXIT_ON_CLOSE);
NOI18N
setTitle("Edit Client");
jLabel4.setText("EDIT CLIENT");

Cancel.setText("Cancel");
javax.swing.GroupLayout layout =
Cancel.addActionListener(new new
java.awt.event.ActionListener() { javax.swing.GroupLayout(getContentPane
());
public void
actionPerformed(java.awt.event.ActionEve getContentPane().setLayout(layout);
nt evt) {
layout.setHorizontalGroup(
CancelActionPerformed(evt);
} layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING)
});

.addGroup(layout.createSequentialGroup(
Submit.setText("Submit"); )

Submit.addActionListener(new
java.awt.event.ActionListener() { .addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.TRAILIN
public void G)
actionPerformed(java.awt.event.ActionEve
nt evt) { .addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_
SubmitActionPerformed(evt); SIZE, 242,
} javax.swing.GroupLayout.PREFERRED_
SIZE)
});

.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
jLabel6.setText("Email Address:");
G)

jLabel5.setText("Phone Number:"); .addGroup(layout.createSequentialGroup(


)
.addGap(119, 119, 119)
jLabel3.setText("Address:");
.addComponent(Submit)) .addComponent(Account)

.addGroup(layout.createSequentialGroup( .addComponent(Phone)
)
.addGap(100, 100, 100) .addComponent(Email)))))))
.addContainerGap(88,
.addGroup(layout.createParallelGroup(jav Short.MAX_VALUE))
ax.swing.GroupLayout.Alignment.TRAILIN
);
G)
layout.setVerticalGroup(
.addComponent(Cancel)
layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup(
)
.addGroup(javax.swing.GroupLayout.Align
ment.TRAILING,
.addGroup(layout.createParallelGroup(jav
layout.createSequentialGroup()
ax.swing.GroupLayout.Alignment.TRAILIN
G) .addGap(22, 22, 22)
.addComponent(jLabel4,
.addComponent(jLabel3) javax.swing.GroupLayout.PREFERRED_
SIZE, 73,
javax.swing.GroupLayout.PREFERRED_
.addComponent(jLabel2)
SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel1)

.addGroup(layout.createParallelGroup(jav
.addComponent(jLabel5)
ax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel6))
.addComponent(jLabel1)
.addGap(18, 18,
.addComponent(Account,
18)
javax.swing.GroupLayout.PREFERRED_
SIZE,
.addGroup(layout.createParallelGroup(jav javax.swing.GroupLayout.DEFAULT_SIZE
ax.swing.GroupLayout.Alignment.LEADIN ,
G, false) javax.swing.GroupLayout.PREFERRED_
SIZE))
.addComponent(Name) .addGap(18, 18, 18)

.addComponent(Address, .addGroup(layout.createParallelGroup(jav
javax.swing.GroupLayout.DEFAULT_SIZE ax.swing.GroupLayout.Alignment.BASELI
, 111, Short.MAX_VALUE) NE)
.addComponent(jLabel2) javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(Name,
javax.swing.GroupLayout.PREFERRED_ .addComponent(jLabel6))
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
.addPreferredGap(javax.swing.LayoutStyl
,
e.ComponentPlacement.RELATED, 32,
javax.swing.GroupLayout.PREFERRED_
Short.MAX_VALUE)
SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
.addGroup(layout.createParallelGroup(jav NE)
ax.swing.GroupLayout.Alignment.LEADIN
.addComponent(Submit)
G)
.addComponent(Cancel))
.addComponent(jLabel3)
.addGap(51, 51, 51))
.addComponent(Address,
javax.swing.GroupLayout.PREFERRED_ );
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
, pack();
javax.swing.GroupLayout.PREFERRED_
SIZE)) }// </editor-fold>

.addGap(20, 20, 20)


private void
.addGroup(layout.createParallelGroup(jav CancelActionPerformed(java.awt.event.Ac
ax.swing.GroupLayout.Alignment.BASELI tionEvent evt) {
NE)
this.setVisible(false);
.addComponent(jLabel5)
new Clients().setVisible(true);
.addComponent(Phone,
}
javax.swing.GroupLayout.PREFERRED_
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
, private void
javax.swing.GroupLayout.PREFERRED_ SubmitActionPerformed(java.awt.event.Ac
SIZE)) tionEvent evt) {

.addGap(18, 18, 18) try {

.addGroup(layout.createParallelGroup(jav String str = Name.getText();


ax.swing.GroupLayout.Alignment.BASELI
NE) String str1 = Address.getText();

.addComponent(Email, String str2 = Phone.getText();


javax.swing.GroupLayout.PREFERRED_
String str3 = Email.getText();
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE String str4 = Account.getText();
,
//<editor-fold defaultstate="collapsed"
desc=" Look and feel setting code
(optional) ">
Class.forName("net.ucanaccess.jdbc.Uca
naccessDriver"); /* If Nimbus (introduced in Java SE
6) is not available, stay with the default
Connection cn =
look and feel.
DriverManager.getConnection("jdbc:ucana
ccess://C:\\Users\\Noel * For details see
Portillo\\Desktop\\Final Project.accdb"); http://download.oracle.com/javase/tutorial/
uiswing/lookandfeel/plaf.html
state = cn.createStatement();
*/
String sql = "Update Clients set
Client_Name = '"+str+"', Address = try {
'"+str1+"', Phone_Number = '"+str2+"',
for
Email_Address = '"+str3+"' Where
(javax.swing.UIManager.LookAndFeelInfo
Account_Number = '"+str4+"'";
info :
state.execute(sql); javax.swing.UIManager.getInstalledLookA
ndFeels()) {
System.out.println("Element is
Edited"); if
("Nimbus".equals(info.getName())) {

}
javax.swing.UIManager.setLookAndFeel(i
catch (Exception ex) { nfo.getClassName());

System.out.println(ex); break;

} }

setVisible(false); }

Edit_ItemGUI form = new } catch (ClassNotFoundException ex)


Edit_ItemGUI(); {

form.setVisible(false);
java.util.logging.Logger.getLogger(Edit_Cli
new Clients().setVisible(true); entGUI.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);

} } catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Edit_Cli
/** entGUI.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);
* @param args the command line
arguments } catch (IllegalAccessException ex) {
*/
java.util.logging.Logger.getLogger(Edit_Cli
public static void main(String args[]) {
entGUI.class.getName()).log(java.util.loggi
/* Set the Nimbus look and feel */ ng.Level.SEVERE, null, ex);
} catch // End of variables declaration
(javax.swing.UnsupportedLookAndFeelEx
}
ception ex) {
Search_Clients.java
java.util.logging.Logger.getLogger(Edit_Cli
entGUI.class.getName()).log(java.util.loggi package projectf1;
ng.Level.SEVERE, null, ex);
} import java.sql.Connection;
//</editor-fold> import java.sql.DriverManager;
import java.sql.PreparedStatement;
/* Create and display the form */ import java.sql.ResultSet;
import javax.swing.JOptionPane;
java.awt.EventQueue.invokeLater(new
Runnable() { import java.lang.String;

public void run() { import java.sql.Statement;

new import net.proteanit.sql.DbUtils;


Edit_ClientGUI().setVisible(true); public class Search_Clients extends
} javax.swing.JFrame {

});
} private Connection conn;
public Statement stmt;

// Variables declaration - do not modify public ResultSet rs;

private javax.swing.JTextField Account;


private javax.swing.JTextField Address; public void Search_Clients(String
Search2) {
private javax.swing.JButton Cancel;
initComponents();
private javax.swing.JTextField Email;
try {
private javax.swing.JTextField Name;
private javax.swing.JTextField Phone;
private javax.swing.JButton Submit; Class.forName("net.ucanaccess.jdbc.Uca
private javax.swing.JLabel jLabel1; naccessDriver");

private javax.swing.JLabel jLabel2; conn =


DriverManager.getConnection("jdbc:ucana
private javax.swing.JLabel jLabel3; ccess://C:\\Users\\Noel
Portillo\\Desktop//Final Project.accdb");
private javax.swing.JLabel jLabel4;
stmt = conn.createStatement();
private javax.swing.JLabel jLabel5;
rs = stmt.executeQuery("Select
private javax.swing.JLabel jLabel6;
Account_Number, Client_Name, Address,
Phone_Number, Email_Address from jLabel1 = new javax.swing.JLabel();
Clients where Account_Number =
Back = new javax.swing.JButton();
'"+Search2+"' or Client_Name =
'"+Search2+"' or Address = '"+Search2+"' jScrollPane1 = new
or Phone_Number = '"+Search2+"' or javax.swing.JScrollPane();
Email_Address = '"+Search2+"'");
tblSearch_Clients = new
javax.swing.JTable();
tblSearch_Clients.setModel(DbUtils.result
SetToTableModel(rs));
new Inventory().setVisible(false);
setDefaultCloseOperation(javax.swing.Wi
this.setVisible(true); ndowConstants.EXIT_ON_CLOSE);
rs.close(); setPreferredSize(new
java.awt.Dimension(476, 374));
conn.close();
}
jLabel1.setText("Search Results: ");

catch(Exception ex)
Back.setText("Back");
{
Back.addActionListener(new
ex.printStackTrace();
java.awt.event.ActionListener() {
System.out.print(ex.toString());
public void
} actionPerformed(java.awt.event.ActionEve
nt evt) {
}
BackActionPerformed(evt);
}
});
/**
* This method is called from within the
constructor to initialize the form. tblSearch_Clients.setModel(new
javax.swing.table.DefaultTableModel(
* WARNING: Do NOT modify this
code. The content of this method is new Object [][] {
always
* regenerated by the Form Editor.
},
*/
new String [] {
@SuppressWarnings("unchecked")
"Account Number", "Client
// <editor-fold defaultstate="collapsed" Name", "Address", "Phone Number",
desc="Generated Code"> "Email Address"
private void initComponents() { }
));
jScrollPane1.setViewportView(tblSearch_ .addGroup(layout.createSequentialGroup(
Clients); )
.addContainerGap()
javax.swing.GroupLayout layout =
new .addGroup(layout.createParallelGroup(jav
javax.swing.GroupLayout(getContentPane ax.swing.GroupLayout.Alignment.LEADIN
()); G)
getContentPane().setLayout(layout); .addComponent(jLabel1)
layout.setHorizontalGroup( .addComponent(Back))
.addGap(18, 18, 18)
layout.createParallelGroup(javax.swing.Gr
.addComponent(jScrollPane1,
oupLayout.Alignment.LEADING)
javax.swing.GroupLayout.PREFERRED_
SIZE, 305,
.addGroup(layout.createSequentialGroup( javax.swing.GroupLayout.PREFERRED_
) SIZE)
.addContainerGap()
.addContainerGap(javax.swing.GroupLay
out.DEFAULT_SIZE,
.addGroup(layout.createParallelGroup(jav
Short.MAX_VALUE))
ax.swing.GroupLayout.Alignment.LEADIN
G) );

.addComponent(jScrollPane1,
pack();
javax.swing.GroupLayout.DEFAULT_SIZE
, 607, Short.MAX_VALUE) }// </editor-fold>

.addGroup(layout.createSequentialGroup(
) private void
BackActionPerformed(java.awt.event.Acti
.addComponent(jLabel1) onEvent evt) {
this.setVisible(false);
.addPreferredGap(javax.swing.LayoutStyl
e.ComponentPlacement.RELATED, new Clients().setVisible(true);
javax.swing.GroupLayout.DEFAULT_SIZE }
, Short.MAX_VALUE)
.addComponent(Back)))
/**
.addContainerGap())
* @param args the command line
); arguments
layout.setVerticalGroup( */
public static void main(String args[]) {
layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING) /* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" } catch
desc=" Look and feel setting code (javax.swing.UnsupportedLookAndFeelEx
(optional) "> ception ex) {
/* If Nimbus (introduced in Java SE
6) is not available, stay with the default java.util.logging.Logger.getLogger(Search
look and feel. _Clients.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
* For details see
http://download.oracle.com/javase/tutorial/ }
uiswing/lookandfeel/plaf.html
//</editor-fold>
*/
try {
/* Create and display the form */
for
}
(javax.swing.UIManager.LookAndFeelInfo
info :
javax.swing.UIManager.getInstalledLookA
ndFeels()) { // Variables declaration - do not modify

if private javax.swing.JButton Back;


("Nimbus".equals(info.getName())) { private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane
javax.swing.UIManager.setLookAndFeel(i jScrollPane1;
nfo.getClassName());
private javax.swing.JTable
break; tblSearch_Clients;
} // End of variables declaration
} }
} catch (ClassNotFoundException ex)
{ Inventory.java

java.util.logging.Logger.getLogger(Search package projectf1;


_Clients.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) { import java.sql.Connection;
import java.sql.DriverManager;
java.util.logging.Logger.getLogger(Search
import java.sql.PreparedStatement;
_Clients.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex); import java.sql.ResultSet;
} catch (IllegalAccessException ex) { import java.sql.Statement;
import javax.swing.JOptionPane;
java.util.logging.Logger.getLogger(Search
_Clients.class.getName()).log(java.util.log import net.proteanit.sql.DbUtils;
ging.Level.SEVERE, null, ex); import javax.swing.JFrame;
Edit = new javax.swing.JButton();
jScrollPane1 = new
javax.swing.JScrollPane();
Clientable = new
public class Inventory extends
javax.swing.JTable();
javax.swing.JFrame {
Edit1 = new javax.swing.JButton();
Report = new javax.swing.JButton();
Delete = new javax.swing.JButton();
Connection cn = null;
jLabel1 = new javax.swing.JLabel();
ResultSet rs = null;
Search1 = new
Statement s = null;
javax.swing.JTextField();
Search_Inventory connE = new
Go = new javax.swing.JButton();
Search_Inventory();
jButton1 = new
public Inventory() {
javax.swing.JButton();
initComponents();
}
setDefaultCloseOperation(javax.swing.Wi
ndowConstants.EXIT_ON_CLOSE);
setTitle("Inventory");
@SuppressWarnings("unchecked")
setPreferredSize(new
// <editor-fold defaultstate="collapsed" java.awt.Dimension(1366, 768));
desc="Generated Code">
private void initComponents() {
jLabel4.setIcon(new
javax.swing.ImageIcon(getClass().getRes
jLabel4 = new javax.swing.JLabel(); ource("/projectf1/logo.jpg"))); // NOI18N

Main = new javax.swing.JButton();


SalesOrder = new Main.setText("Main Page");
javax.swing.JButton(); Main.addActionListener(new
Clients = new javax.swing.JButton(); java.awt.event.ActionListener() {

Inventory = new public void


javax.swing.JButton(); actionPerformed(java.awt.event.ActionEve
nt evt) {
jLabel2 = new javax.swing.JLabel();
MainActionPerformed(evt);
jSeparator1 = new
javax.swing.JSeparator(); }

jSeparator2 = new });


javax.swing.JSeparator();
Add = new javax.swing.JButton(); SalesOrder.setText("Sales Order");
SalesOrder.addActionListener(new
java.awt.event.ActionListener() { jSeparator2.setOrientation(javax.swing.Sw
ingConstants.VERTICAL);
public void
actionPerformed(java.awt.event.ActionEve
nt evt) {
Add.setText("Add");
Add.addActionListener(new
SalesOrderActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
}); actionPerformed(java.awt.event.ActionEve
nt evt) {
AddActionPerformed(evt);
Clients.setText("Clients");
}
Clients.addActionListener(new
java.awt.event.ActionListener() { });
public void
actionPerformed(java.awt.event.ActionEve
Edit.setText("Refresh");
nt evt) {
Edit.addActionListener(new
ClientsActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
}); actionPerformed(java.awt.event.ActionEve
nt evt) {
EditActionPerformed(evt);
Inventory.setText("Inventory");
}
Inventory.setEnabled(false);
});
Inventory.addActionListener(new
java.awt.event.ActionListener() {
public void Clientable.setModel(new
actionPerformed(java.awt.event.ActionEve javax.swing.table.DefaultTableModel(
nt evt) {
new Object [][] {
InventoryActionPerformed(evt);
}
},
});
new String [] {
"Control Number", "Brand",
jLabel2.setFont(new "Stocks"
java.awt.Font("Tahoma", 1, 14)); //
}
NOI18N
));
jLabel2.setText("Inventory");

jScrollPane1.setViewportView(Clientable);
public void
actionPerformed(java.awt.event.ActionEve
Edit1.setText("Edit");
nt evt) {
Edit1.addActionListener(new
Search1ActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
actionPerformed(java.awt.event.ActionEve });
nt evt) {
Edit1ActionPerformed(evt);
Go.setText("Go");
}
Go.addActionListener(new
}); java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEve
Report.setText("Out of Stock Items");
nt evt) {
Report.addActionListener(new
GoActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
actionPerformed(java.awt.event.ActionEve });
nt evt) {
ReportActionPerformed(evt);
jButton1.setText("Over Stock Items");
}
jButton1.addActionListener(new
}); java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEve
Delete.setText("Delete");
nt evt) {
Delete.addActionListener(new
jButton1ActionPerformed(evt);
java.awt.event.ActionListener() {
}
public void
actionPerformed(java.awt.event.ActionEve });
nt evt) {
DeleteActionPerformed(evt);
javax.swing.GroupLayout layout =
} new
javax.swing.GroupLayout(getContentPane
});
());
getContentPane().setLayout(layout);
jLabel1.setText("Search Inventory: ");
layout.setHorizontalGroup(

Search1.addActionListener(new layout.createParallelGroup(javax.swing.Gr
java.awt.event.ActionListener() { oupLayout.Alignment.LEADING)
SIZE, 110,
.addGroup(layout.createSequentialGroup( javax.swing.GroupLayout.PREFERRED_
) SIZE)))
.addContainerGap()
.addGroup(layout.createSequentialGroup(
)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN .addGap(10, 10, 10)
G)
.addComponent(jLabel4)))
.addGroup(layout.createSequentialGroup(
.addGap(18, 18, 18)
)

.addComponent(jSeparator2,
.addGroup(layout.createParallelGroup(jav
javax.swing.GroupLayout.PREFERRED_
ax.swing.GroupLayout.Alignment.LEADIN
SIZE, 66,
G)
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addGroup(layout.createSequentialGroup(
.addGap(190, 190, 190)
)
.addGap(99, 99, 99)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
.addGroup(layout.createParallelGroup(jav G)
ax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup(
)
.addComponent(Clients,
.addComponent(Add,
javax.swing.GroupLayout.PREFERRED_
javax.swing.GroupLayout.PREFERRED_
SIZE, 110,
SIZE, 83,
javax.swing.GroupLayout.PREFERRED_
javax.swing.GroupLayout.PREFERRED_
SIZE)
SIZE)
.addGap(18, 18, 18)
.addComponent(SalesOrder,
javax.swing.GroupLayout.PREFERRED_
SIZE, 110, .addComponent(Edit1,
javax.swing.GroupLayout.PREFERRED_ javax.swing.GroupLayout.PREFERRED_
SIZE) SIZE, 83,
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(Main,
javax.swing.GroupLayout.PREFERRED_ .addGap(18, 18, 18)
SIZE, 110,
javax.swing.GroupLayout.PREFERRED_ .addComponent(Edit,
SIZE) javax.swing.GroupLayout.PREFERRED_
SIZE, 84,
javax.swing.GroupLayout.PREFERRED_
.addComponent(Inventory, SIZE)
javax.swing.GroupLayout.PREFERRED_
.addGap(18, 18, 18) .addComponent(Search1,
javax.swing.GroupLayout.PREFERRED_
SIZE, 130,
.addComponent(Delete))
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(jScrollPane1,
.addGap(18, 18, 18)
javax.swing.GroupLayout.PREFERRED_
SIZE, 647, .addComponent(Go)
javax.swing.GroupLayout.PREFERRED_
.addGap(147, 147, 147))
SIZE)
);
.addGroup(layout.createSequentialGroup( layout.setVerticalGroup(
)

layout.createParallelGroup(javax.swing.Gr
.addComponent(Report) oupLayout.Alignment.LEADING)
.addGap(18, 18, 18)
.addGroup(layout.createSequentialGroup(
)
.addComponent(jButton1))))
.addComponent(jSeparator1,
.addGroup(layout.createParallelGroup(jav
javax.swing.GroupLayout.PREFERRED_
ax.swing.GroupLayout.Alignment.LEADIN
SIZE, 1357,
G)
javax.swing.GroupLayout.PREFERRED_
SIZE))
.addGroup(layout.createSequentialGroup(
)
.addContainerGap(javax.swing.GroupLay
out.DEFAULT_SIZE, .addGap(12, 12, 12)
Short.MAX_VALUE))

.addGroup(layout.createParallelGroup(jav
.addGroup(javax.swing.GroupLayout.Align ax.swing.GroupLayout.Alignment.BASELI
ment.TRAILING, NE)
layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(104, 104, 104)
.addComponent(jLabel2) .addComponent(Search1,
javax.swing.GroupLayout.PREFERRED_
SIZE,
.addPreferredGap(javax.swing.LayoutStyl
javax.swing.GroupLayout.DEFAULT_SIZE
e.ComponentPlacement.RELATED,
,
javax.swing.GroupLayout.DEFAULT_SIZE
javax.swing.GroupLayout.PREFERRED_
, Short.MAX_VALUE)
SIZE)
.addComponent(jLabel1)
.addComponent(Go)))

.addPreferredGap(javax.swing.LayoutStyl
.addGroup(layout.createSequentialGroup(
e.ComponentPlacement.RELATED)
)
.addGap(26, 26, 26)
.addGroup(javax.swing.GroupLayout.Align
.addComponent(jLabel2)))
ment.TRAILING,
.addGap(28, 28, 28) layout.createSequentialGroup()

.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_ .addPreferredGap(javax.swing.LayoutStyl
SIZE, 10, e.ComponentPlacement.RELATED)
javax.swing.GroupLayout.PREFERRED_
SIZE)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
.addGroup(layout.createParallelGroup(jav G)
ax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup(
)
.addGroup(layout.createSequentialGroup(
)
.addComponent(jLabel4)
.addGap(54, 54, 54)
.addGap(50, 50, 50)
.addComponent(Main)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI .addGap(18, 18, 18)
NE)
.addComponent(Add) .addComponent(SalesOrder)
.addComponent(Edit) .addGap(18, 18, 18)
.addComponent(Edit1)
.addComponent(Clients)
.addComponent(Delete))
.addGap(18, 18, 18)
.addGap(18, 18, 18)

.addComponent(Inventory))
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_
SIZE, 427, .addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_ javax.swing.GroupLayout.PREFERRED_
SIZE) SIZE, 696,
javax.swing.GroupLayout.PREFERRED_
.addGap(18, 18, 18)
SIZE))))

.addGroup(layout.createParallelGroup(jav
.addContainerGap(javax.swing.GroupLay
ax.swing.GroupLayout.Alignment.BASELI
out.DEFAULT_SIZE,
NE)
Short.MAX_VALUE))
.addComponent(Report)
);

.addComponent(jButton1)))
pack();
}// </editor-fold> new Add_ItemGUI().setVisible(true);
}
private void
MainActionPerformed(java.awt.event.Actio
private void
nEvent evt) {
EditActionPerformed(java.awt.event.Actio
this.setVisible(false); nEvent evt) {
new Main_Admin().setVisible(true); try {
} Connection
conn=DriverManager.getConnection("jdbc
:ucanaccess://C:\\Users\\Noel
private void Portillo\\Desktop\\Final Project.accdb");
SalesOrderActionPerformed(java.awt.eve
String sql="select
nt.ActionEvent evt) {
Control_Number,Brand,Stocks from
JFrame frame = new Products";
JFrame("JOptionPane
PreparedStatement
showMessageDialog example");
pst=conn.prepareStatement(sql);
ResultSet rs=pst.executeQuery();
JOptionPane.showMessageDialog(frame,
"Feature comming soon!!");
Clientable.setModel(DbUtils.resultSetToT
}
ableModel(rs));
}
private void
catch(Exception ex)
ClientsActionPerformed(java.awt.event.Ac
tionEvent evt) { {
this.setVisible(false);
JOptionPane.showMessageDialog(null,
new Clients().setVisible(true);
ex);
}
}
}
private void
InventoryActionPerformed(java.awt.event.
ActionEvent evt) { private void
Edit1ActionPerformed(java.awt.event.Acti
// TODO add your handling code
onEvent evt) {
here:
this.setVisible(false);
}
new Edit_ItemGUI().setVisible(true);
}
private void
AddActionPerformed(java.awt.event.Actio
nEvent evt) {
this.setVisible(false);
private void private void
ReportActionPerformed(java.awt.event.Ac Search1ActionPerformed(java.awt.event.A
tionEvent evt) { ctionEvent evt) {
// TODO add your handling code
here:
this.setVisible(false);
}
new Out_of_Stock().setVisible(true);
}
private void
GoActionPerformed(java.awt.event.Action
private void Event evt) {
DeleteActionPerformed(java.awt.event.Act
ionEvent evt) {
connE.Search_Inventory(Search1.getText
String Input = ());
JOptionPane.showInputDialog("Enter
}
Control Number: ");
try {
private void
jButton1ActionPerformed(java.awt.event.A
Class.forName("net.ucanaccess.jdbc.Uca
ctionEvent evt) {
naccessDriver");
this.setVisible(false);
cn =
DriverManager.getConnection("jdbc:ucana new Over_Stock().setVisible(true);
ccess://C:\\Users\\Noel
}
Portillo\\Desktop//Final Project.accdb");
String sql = "Delete from Products
where Control_Number = '"+Input+"' "; /**
s = cn.createStatement(); * @param args the command line
arguments
s.executeUpdate(sql);
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
}
//<editor-fold defaultstate="collapsed"
catch (Exception ex) {
desc=" Look and feel setting code
(optional) ">
JOptionPane.showMessageDialog(null,
/* If Nimbus (introduced in Java SE
ex);
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 { /* Create and display the form */
for
(javax.swing.UIManager.LookAndFeelInfo java.awt.EventQueue.invokeLater(new
info : Runnable() {
javax.swing.UIManager.getInstalledLookA
public void run() {
ndFeels()) {
new Inventory().setVisible(true);
if
("Nimbus".equals(info.getName())) { }
});
javax.swing.UIManager.setLookAndFeel(i
nfo.getClassName()); }

break;
} // Variables declaration - do not modify

} private javax.swing.JButton Add;

} catch (ClassNotFoundException ex) private javax.swing.JTable Clientable;


{ private javax.swing.JButton Clients;
private javax.swing.JButton Delete;
java.util.logging.Logger.getLogger(Invento
ry.class.getName()).log(java.util.logging.L private javax.swing.JButton Edit;
evel.SEVERE, null, ex);
private javax.swing.JButton Edit1;
} catch (InstantiationException ex) {
private javax.swing.JButton Go;
private javax.swing.JButton Inventory;
java.util.logging.Logger.getLogger(Invento
ry.class.getName()).log(java.util.logging.L private javax.swing.JButton Main;
evel.SEVERE, null, ex);
private javax.swing.JButton Report;
} catch (IllegalAccessException ex) {
private javax.swing.JButton SalesOrder;

java.util.logging.Logger.getLogger(Invento private javax.swing.JTextField Search1;


ry.class.getName()).log(java.util.logging.L private javax.swing.JButton jButton1;
evel.SEVERE, null, ex);
private javax.swing.JLabel jLabel1;
} catch
(javax.swing.UnsupportedLookAndFeelEx private javax.swing.JLabel jLabel2;
ception ex) {
private javax.swing.JLabel jLabel4;
private javax.swing.JScrollPane
java.util.logging.Logger.getLogger(Invento
jScrollPane1;
ry.class.getName()).log(java.util.logging.L
evel.SEVERE, null, ex); private javax.swing.JSeparator
jSeparator1;
}
private javax.swing.JSeparator
//</editor-fold>
jSeparator2;
// End of variables declaration
} Control = new
javax.swing.JTextField();
Add_ItemGUI.java
Brand = new
package projectf1; javax.swing.JTextField();
Stock = new
javax.swing.JTextField();
import java.sql.Connection;
Cancel = new javax.swing.JButton();
import java.sql.DriverManager;
Submit = new javax.swing.JButton();
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JOptionPane; setDefaultCloseOperation(javax.swing.Wi
ndowConstants.EXIT_ON_CLOSE);
setTitle("Add Item");

public class Add_ItemGUI extends


javax.swing.JFrame { jLabel4.setFont(new
java.awt.Font("Tahoma", 1, 36)); //
NOI18N
Connection cn = null;
jLabel4.setText("ADD ITEM");
ResultSet rs = null;
Statement s = null;
jLabel1.setText("Control Number:");

public Add_ItemGUI() {
jLabel2.setText("Brand:");
initComponents();
}
jLabel3.setText("Stock:");

Cancel.setText("Cancel");
@SuppressWarnings("unchecked")
Cancel.addActionListener(new
// <editor-fold defaultstate="collapsed" java.awt.event.ActionListener() {
desc="Generated Code">
public void
private void initComponents() { actionPerformed(java.awt.event.ActionEve
nt evt) {

jLabel4 = new javax.swing.JLabel(); CancelActionPerformed(evt);

jLabel1 = new javax.swing.JLabel(); }

jLabel2 = new javax.swing.JLabel(); });

jLabel3 = new javax.swing.JLabel();


Submit.setText("Submit");
Submit.addActionListener(new ax.swing.GroupLayout.Alignment.TRAILIN
java.awt.event.ActionListener() { G)
public void
actionPerformed(java.awt.event.ActionEve .addGroup(layout.createSequentialGroup(
nt evt) { )
SubmitActionPerformed(evt);
.addComponent(Submit)
}
.addGap(39, 39, 39)
});

.addComponent(Cancel))
javax.swing.GroupLayout layout =
new
.addGroup(layout.createSequentialGroup(
javax.swing.GroupLayout(getContentPane
)
());
getContentPane().setLayout(layout);
.addGroup(layout.createParallelGroup(jav
layout.setHorizontalGroup( ax.swing.GroupLayout.Alignment.TRAILIN
G)

layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING) .addComponent(jLabel3)

.addGroup(layout.createSequentialGroup( .addComponent(jLabel2)
)
.addComponent(jLabel1))
.addGroup(layout.createParallelGroup(jav
.addGap(18, 18, 18)
ax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
.addGroup(layout.createSequentialGroup(
G, false)
)
.addGap(96, 96, 96)
.addComponent(Control)
.addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_
.addComponent(Brand)
SIZE, 208,
javax.swing.GroupLayout.PREFERRED_
SIZE)) .addComponent(Stock,
javax.swing.GroupLayout.DEFAULT_SIZE
, 111, Short.MAX_VALUE))))))
.addGroup(layout.createSequentialGroup(
) .addContainerGap(96,
Short.MAX_VALUE))
.addGap(70, 70, 70)
);
.addGroup(layout.createParallelGroup(jav layout.setVerticalGroup(
.addComponent(jLabel3)
layout.createParallelGroup(javax.swing.Gr
.addComponent(Stock,
oupLayout.Alignment.LEADING)
javax.swing.GroupLayout.PREFERRED_
SIZE,
.addGroup(layout.createSequentialGroup( javax.swing.GroupLayout.DEFAULT_SIZE
) ,
javax.swing.GroupLayout.PREFERRED_
.addGap(24, 24, 24)
SIZE))
.addComponent(jLabel4,
.addGap(18, 18, 18)
javax.swing.GroupLayout.DEFAULT_SIZE
, 61, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
.addPreferredGap(javax.swing.LayoutStyl
NE)
e.ComponentPlacement.UNRELATED)
.addComponent(Cancel)
.addGroup(layout.createParallelGroup(jav .addComponent(Submit))
ax.swing.GroupLayout.Alignment.BASELI
.addGap(73, 73, 73))
NE)
);
.addComponent(jLabel1)
.addComponent(Control,
javax.swing.GroupLayout.PREFERRED_ pack();
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE }// </editor-fold>
,
javax.swing.GroupLayout.PREFERRED_
SIZE)) private void
SubmitActionPerformed(java.awt.event.Ac
.addGap(15, 15, 15) tionEvent evt) {
try {
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
NE)
String str = Control.getText();
.addComponent(jLabel2)
String str1 = Brand.getText();
.addComponent(Brand,
String str2 = Stock.getText();
javax.swing.GroupLayout.PREFERRED_
SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
,
javax.swing.GroupLayout.PREFERRED_ Class.forName("net.ucanaccess.jdbc.Uca
SIZE)) naccessDriver");

.addGap(15, 15, 15) Connection cn =


DriverManager.getConnection("jdbc:ucana
ccess://C:\\Users\\Noel
.addGroup(layout.createParallelGroup(jav Portillo\\Desktop\\Final Project.accdb");
ax.swing.GroupLayout.Alignment.BASELI
NE)
String sql = "insert into Products * For details see
(Control_Number, Brand, Stocks) values http://download.oracle.com/javase/tutorial/
('"+str+"', '"+str1+"', '"+str2+"')"; uiswing/lookandfeel/plaf.html
s = cn.createStatement(); */
s.executeUpdate(sql); try {
for
(javax.swing.UIManager.LookAndFeelInfo
} catch (Exception ex) {
info :
javax.swing.UIManager.getInstalledLookA
JOptionPane.showMessageDialog(null, ndFeels()) {
ex);
if
} ("Nimbus".equals(info.getName())) {

setVisible(false);
javax.swing.UIManager.setLookAndFeel(i
Add_ItemGUI form = new nfo.getClassName());
Add_ItemGUI();
break;
form.setVisible(false);
}
new Inventory().setVisible(true);
}
}
} catch (ClassNotFoundException ex)
{
private void
CancelActionPerformed(java.awt.event.Ac java.util.logging.Logger.getLogger(Add_Ite
tionEvent evt) { mGUI.class.getName()).log(java.util.loggin
this.setVisible(false); g.Level.SEVERE, null, ex);

new Inventory().setVisible(true); } catch (InstantiationException ex) {

}
java.util.logging.Logger.getLogger(Add_Ite
mGUI.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
/**
} catch (IllegalAccessException ex) {
* @param args the command line
arguments
java.util.logging.Logger.getLogger(Add_Ite
*/
mGUI.class.getName()).log(java.util.loggin
public static void main(String args[]) { g.Level.SEVERE, null, ex);

/* Set the Nimbus look and feel */ } catch


(javax.swing.UnsupportedLookAndFeelEx
//<editor-fold defaultstate="collapsed" ception ex) {
desc=" Look and feel setting code
(optional) ">
java.util.logging.Logger.getLogger(Add_Ite
/* If Nimbus (introduced in Java SE mGUI.class.getName()).log(java.util.loggin
6) is not available, stay with the default g.Level.SEVERE, null, ex);
look and feel.
} import java.sql.Statement;
//</editor-fold>

/* Create and display the form */ public class Edit_ItemGUI extends


javax.swing.JFrame {
java.awt.EventQueue.invokeLater(new
Runnable() {
Connection cn = null;
public void run() {
ResultSet rs = null;
new
Statement state = null;
Add_ItemGUI().setVisible(true);
}
public Edit_ItemGUI() {
});
initComponents();
}
}

// Variables declaration - do not modify


private javax.swing.JTextField Brand;
@SuppressWarnings("unchecked")
private javax.swing.JButton Cancel;
// <editor-fold defaultstate="collapsed"
private javax.swing.JTextField Control;
desc="Generated Code">
private javax.swing.JTextField Stock;
private void initComponents() {
private javax.swing.JButton Submit;
private javax.swing.JLabel jLabel1;
jLabel1 = new javax.swing.JLabel();
private javax.swing.JLabel jLabel2;
jLabel2 = new javax.swing.JLabel();
private javax.swing.JLabel jLabel3;
jLabel3 = new javax.swing.JLabel();
private javax.swing.JLabel jLabel4;
Control = new
// End of variables declaration javax.swing.JTextField();
} Brand = new
javax.swing.JTextField();
Edit_ItemGUI.java
Stock = new
javax.swing.JTextField();

package projectf1; jLabel4 = new javax.swing.JLabel();


Submit = new javax.swing.JButton();

import java.sql.Connection; Cancel = new javax.swing.JButton();

import java.sql.DriverManager;
import java.sql.ResultSet;
javax.swing.GroupLayout layout =
setDefaultCloseOperation(javax.swing.Wi new
ndowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout(getContentPane
());
setTitle("Edit Item");
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
jLabel1.setText("Control Number:");

layout.createParallelGroup(javax.swing.Gr
jLabel2.setText("Brand:"); oupLayout.Alignment.LEADING)

.addGroup(javax.swing.GroupLayout.Align
jLabel3.setText("Stock:"); ment.TRAILING,
layout.createSequentialGroup()

jLabel4.setFont(new .addContainerGap(93,
java.awt.Font("Tahoma", 1, 36)); // Short.MAX_VALUE)
NOI18N .addComponent(jLabel4,
jLabel4.setText("EDIT ITEM"); javax.swing.GroupLayout.PREFERRED_
SIZE, 208,
javax.swing.GroupLayout.PREFERRED_
SIZE)
Submit.setText("Submit");
.addGap(93, 93, 93))
Submit.addActionListener(new
java.awt.event.ActionListener() {
.addGroup(layout.createSequentialGroup(
public void
)
actionPerformed(java.awt.event.ActionEve
nt evt) {
.addGroup(layout.createParallelGroup(jav
SubmitActionPerformed(evt);
ax.swing.GroupLayout.Alignment.LEADIN
} G)

});
.addGroup(layout.createSequentialGroup(
)
Cancel.setText("Cancel"); .addGap(119, 119, 119)
Cancel.addActionListener(new .addComponent(Submit))
java.awt.event.ActionListener() {
public void .addGroup(layout.createSequentialGroup(
actionPerformed(java.awt.event.ActionEve )
nt evt) {
.addGap(70, 70, 70)
CancelActionPerformed(evt);
} .addGroup(layout.createParallelGroup(jav
}); ax.swing.GroupLayout.Alignment.TRAILIN
G)
.addGap(24, 24, 24)
.addGroup(layout.createSequentialGroup(
.addComponent(jLabel4,
)
javax.swing.GroupLayout.DEFAULT_SIZE
, 64, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(jav
.addGap(18, 18, 18)
ax.swing.GroupLayout.Alignment.TRAILIN
G)
.addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
.addComponent(jLabel3)
NE)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(Control,
javax.swing.GroupLayout.PREFERRED_
.addComponent(jLabel1))
SIZE,
.addGap(18, 18, 18) javax.swing.GroupLayout.DEFAULT_SIZE
,
javax.swing.GroupLayout.PREFERRED_
.addGroup(layout.createParallelGroup(jav
SIZE))
ax.swing.GroupLayout.Alignment.LEADIN
G, false) .addGap(21, 21, 21)

.addComponent(Brand) .addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(Stock,
javax.swing.GroupLayout.DEFAULT_SIZE .addComponent(jLabel2)
, 111, Short.MAX_VALUE)
.addComponent(Brand,
javax.swing.GroupLayout.PREFERRED_
.addComponent(Control))) SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE
,
.addComponent(Cancel))))
javax.swing.GroupLayout.PREFERRED_
SIZE))
.addContainerGap(javax.swing.GroupLay
.addGap(21, 21, 21)
out.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(jav
);
ax.swing.GroupLayout.Alignment.BASELI
layout.setVerticalGroup( NE)
.addComponent(jLabel3)
layout.createParallelGroup(javax.swing.Gr
.addComponent(Stock,
oupLayout.Alignment.LEADING)
javax.swing.GroupLayout.PREFERRED_
SIZE,
.addGroup(javax.swing.GroupLayout.Align javax.swing.GroupLayout.DEFAULT_SIZE
ment.TRAILING, ,
layout.createSequentialGroup() javax.swing.GroupLayout.PREFERRED_
SIZE))
.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(jav
}
ax.swing.GroupLayout.Alignment.BASELI
NE) catch (Exception ex) {
.addComponent(Submit) System.out.println(ex);
.addComponent(Cancel)) }
.addGap(51, 51, 51)) setVisible(false);
); Edit_ItemGUI form = new
Edit_ItemGUI();
form.setVisible(false);
pack();
new Inventory().setVisible(true);
}// </editor-fold>
}

private void
SubmitActionPerformed(java.awt.event.Ac private void
tionEvent evt) { CancelActionPerformed(java.awt.event.Ac
tionEvent evt) {
try {
this.setVisible(false);
new Inventory().setVisible(true);
String str = Brand.getText();
}
String str1 = Control.getText();
String str2 = Stock.getText();
/**
* @param args the command line
arguments
Class.forName("net.ucanaccess.jdbc.Uca
naccessDriver"); */
Connection cn = public static void main(String args[]) {
DriverManager.getConnection("jdbc:ucana
ccess://C:\\Users\\Noel /* Set the Nimbus look and feel */
Portillo\\Desktop\\Final Project.accdb"); //<editor-fold defaultstate="collapsed"
state = cn.createStatement(); desc=" Look and feel setting code
(optional) ">
String sql = "Update Products
set Brand = '"+str+"', Stocks = '"+str2+"' /* If Nimbus (introduced in Java SE
Where Control_Number = '"+str1+"'"; 6) is not available, stay with the default
look and feel.
state.execute(sql);
* For details see
System.out.println("Element is http://download.oracle.com/javase/tutorial/
Edited"); uiswing/lookandfeel/plaf.html
cn.close(); */
try { /* Create and display the form */
for
(javax.swing.UIManager.LookAndFeelInfo java.awt.EventQueue.invokeLater(new
info : Runnable() {
javax.swing.UIManager.getInstalledLookA
public void run() {
ndFeels()) {
new
if
Edit_ItemGUI().setVisible(true);
("Nimbus".equals(info.getName())) {
}
javax.swing.UIManager.setLookAndFeel(i });
nfo.getClassName());
}
break;
}
// Variables declaration - do not modify
}
private javax.swing.JTextField Brand;
} catch (ClassNotFoundException ex)
{ private javax.swing.JButton Cancel;
private javax.swing.JTextField Control;
java.util.logging.Logger.getLogger(Edit_Ite private javax.swing.JTextField Stock;
mGUI.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex); private javax.swing.JButton Submit;

} catch (InstantiationException ex) { private javax.swing.JLabel jLabel1;


private javax.swing.JLabel jLabel2;
java.util.logging.Logger.getLogger(Edit_Ite
private javax.swing.JLabel jLabel3;
mGUI.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex); private javax.swing.JLabel jLabel4;
} catch (IllegalAccessException ex) { // End of variables declaration
}
java.util.logging.Logger.getLogger(Edit_Ite
mGUI.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
Out_of_Stock.java
} catch
(javax.swing.UnsupportedLookAndFeelEx
ception ex) { package projectf1;

java.util.logging.Logger.getLogger(Edit_Ite
mGUI.class.getName()).log(java.util.loggin import java.sql.Connection;
g.Level.SEVERE, null, ex);
import java.sql.DriverManager;
}
import java.sql.PreparedStatement;
//</editor-fold>
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import net.proteanit.sql.DbUtils;
jScrollPane1 = new
javax.swing.JScrollPane();
tblOut_of_Stock = new
public class Out_of_Stock extends
javax.swing.JTable();
javax.swing.JFrame {
Back = new javax.swing.JButton();

public Out_of_Stock() {
setDefaultCloseOperation(javax.swing.Wi
initComponents(); ndowConstants.EXIT_ON_CLOSE);

try { setTitle("Out of Stock");

Connection
conn=DriverManager.getConnection("jdbc
tblOut_of_Stock.setModel(new
:ucanaccess://C:\\Users\\Noel
javax.swing.table.DefaultTableModel(
Portillo\\Desktop\\Final Project.accdb");
new Object [][] {
String sql="select
Control_Number,Brand,Stocks from
Products where Stocks = 0";
},
PreparedStatement
new String [] {
pst=conn.prepareStatement(sql);
"Control Number", "Brand",
ResultSet rs=pst.executeQuery();
"Stock"
}
tblOut_of_Stock.setModel(DbUtils.resultS
etToTableModel(rs)); ));
}
jScrollPane1.setViewportView(tblOut_of_
catch(Exception ex)
Stock);
{

Back.setText("Back");
JOptionPane.showMessageDialog(null,
ex); Back.addActionListener(new
java.awt.event.ActionListener() {
}
public void
}
actionPerformed(java.awt.event.ActionEve
nt evt) {
BackActionPerformed(evt);
@SuppressWarnings("unchecked") }
// <editor-fold defaultstate="collapsed" });
desc="Generated Code">
private void initComponents() {
javax.swing.GroupLayout layout = javax.swing.GroupLayout.PREFERRED_
new SIZE)
javax.swing.GroupLayout(getContentPane
.addGap(18, 18, 18)
());
.addComponent(Back)
getContentPane().setLayout(layout);
.addContainerGap(44,
layout.setHorizontalGroup(
Short.MAX_VALUE))
);
layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING)

pack();
.addGroup(layout.createSequentialGroup(
) }// </editor-fold>

.addGap(115, 115, 115)


private void
.addGroup(layout.createParallelGroup(jav BackActionPerformed(java.awt.event.Acti
ax.swing.GroupLayout.Alignment.TRAILIN onEvent evt) {
G) this.setVisible(false);
new Inventory().setVisible(true);
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_ }
SIZE, 375,
javax.swing.GroupLayout.PREFERRED_
SIZE) /**
.addComponent(Back, * @param args the command line
javax.swing.GroupLayout.PREFERRED_ arguments
SIZE, 66,
javax.swing.GroupLayout.PREFERRED_ */
SIZE)) public static void main(String args[]) {
.addContainerGap(145, /* Set the Nimbus look and feel */
Short.MAX_VALUE))
//<editor-fold defaultstate="collapsed"
); desc=" Look and feel setting code
layout.setVerticalGroup( (optional) ">
/* If Nimbus (introduced in Java SE
layout.createParallelGroup(javax.swing.Gr 6) is not available, stay with the default
oupLayout.Alignment.LEADING) look and feel.
* For details see
.addGroup(layout.createSequentialGroup( http://download.oracle.com/javase/tutorial/
) uiswing/lookandfeel/plaf.html

.addGap(54, 54, 54) */

.addComponent(jScrollPane1, try {
javax.swing.GroupLayout.PREFERRED_ for
SIZE, 275, (javax.swing.UIManager.LookAndFeelInfo
info :
javax.swing.UIManager.getInstalledLookA java.awt.EventQueue.invokeLater(new
ndFeels()) { Runnable() {
if public void run() {
("Nimbus".equals(info.getName())) {
new
Out_of_Stock().setVisible(true);
javax.swing.UIManager.setLookAndFeel(i
}
nfo.getClassName());
});
break;
}
}
}
// Variables declaration - do not modify
} catch (ClassNotFoundException ex)
{ private javax.swing.JButton Back;
private javax.swing.JScrollPane
java.util.logging.Logger.getLogger(Out_of jScrollPane1;
_Stock.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex); private javax.swing.JTable
tblOut_of_Stock;
} catch (InstantiationException ex) {
// End of variables declaration

java.util.logging.Logger.getLogger(Out_of }
_Stock.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex); Over_Stock.java
} catch (IllegalAccessException ex) { package projectf1;

java.util.logging.Logger.getLogger(Out_of import java.sql.Connection;


_Stock.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex); import java.sql.DriverManager;
} catch import java.sql.PreparedStatement;
(javax.swing.UnsupportedLookAndFeelEx
import java.sql.ResultSet;
ception ex) {
import javax.swing.JOptionPane;
java.util.logging.Logger.getLogger(Out_of import net.proteanit.sql.DbUtils;
_Stock.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);
} /**

//</editor-fold> *
* @author Noel Portillo

/* Create and display the form */ */


public class Over_Stock extends
javax.swing.JFrame {
@SuppressWarnings("unchecked")
/** // <editor-fold defaultstate="collapsed"
desc="Generated Code">
* Creates new form Over_Stock
private void initComponents() {
*/
public Over_Stock() {
jScrollPane1 = new
initComponents();
javax.swing.JScrollPane();
try {
Over_Stock = new
Connection javax.swing.JTable();
conn=DriverManager.getConnection("jdbc
Back = new javax.swing.JButton();
:ucanaccess://C:\\Users\\Noel
Portillo\\Desktop\\Final Project.accdb");
String sql="select
Control_Number,Brand,Stocks from setDefaultCloseOperation(javax.swing.Wi
Products where Stocks >= 50"; ndowConstants.EXIT_ON_CLOSE);
PreparedStatement setTitle("Over Stock");
pst=conn.prepareStatement(sql);
ResultSet rs=pst.executeQuery();
Over_Stock.setModel(new
javax.swing.table.DefaultTableModel(
Over_Stock.setModel(DbUtils.resultSetTo
new Object [][] {
TableModel(rs));
}
},
catch(Exception ex)
new String [] {
{
"Control Number", "Brand",
"Stock"
JOptionPane.showMessageDialog(null,
ex); }
} ));
}
jScrollPane1.setViewportView(Over_Stock
);
/**
* This method is called from within the
Back.setText("Back");
constructor to initialize the form.
Back.addActionListener(new
* WARNING: Do NOT modify this
java.awt.event.ActionListener() {
code. The content of this method is
always public void
actionPerformed(java.awt.event.ActionEve
* regenerated by the Form Editor.
nt evt) {
*/
BackActionPerformed(evt);
} .addGap(54, 54, 54)
}); .addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_
SIZE, 275,
javax.swing.GroupLayout layout = javax.swing.GroupLayout.PREFERRED_
new SIZE)
javax.swing.GroupLayout(getContentPane
.addGap(18, 18, 18)
());
.addComponent(Back)
getContentPane().setLayout(layout);
.addContainerGap(34,
layout.setHorizontalGroup(
Short.MAX_VALUE))
);
layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING)
pack();
.addGroup(layout.createSequentialGroup(
}// </editor-fold>
)
.addGap(115, 115, 115)
private void
BackActionPerformed(java.awt.event.Acti
.addGroup(layout.createParallelGroup(jav
onEvent evt) {
ax.swing.GroupLayout.Alignment.TRAILIN
G) this.setVisible(false);
new Inventory().setVisible(true);
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_ }
SIZE, 375,
javax.swing.GroupLayout.PREFERRED_
SIZE) /**

.addComponent(Back, * @param args the command line


javax.swing.GroupLayout.PREFERRED_ arguments
SIZE, 66,
*/
javax.swing.GroupLayout.PREFERRED_
SIZE)) public static void main(String args[]) {
.addContainerGap(98, /* Set the Nimbus look and feel */
Short.MAX_VALUE))
//<editor-fold defaultstate="collapsed"
); desc=" Look and feel setting code
(optional) ">
layout.setVerticalGroup(
/* If Nimbus (introduced in Java SE
6) is not available, stay with the default
layout.createParallelGroup(javax.swing.Gr
look and feel.
oupLayout.Alignment.LEADING)
* For details see
http://download.oracle.com/javase/tutorial/
.addGroup(layout.createSequentialGroup(
uiswing/lookandfeel/plaf.html
)
*/
try { /* Create and display the form */
for
(javax.swing.UIManager.LookAndFeelInfo java.awt.EventQueue.invokeLater(new
info : Runnable() {
javax.swing.UIManager.getInstalledLookA
public void run() {
ndFeels()) {
new
if
Over_Stock().setVisible(true);
("Nimbus".equals(info.getName())) {
}
javax.swing.UIManager.setLookAndFeel(i });
nfo.getClassName());
}
break;
}
// Variables declaration - do not modify
}
private javax.swing.JButton Back;
} catch (ClassNotFoundException ex)
{ private javax.swing.JTable Over_Stock;
private javax.swing.JScrollPane
java.util.logging.Logger.getLogger(Over_S jScrollPane1;
tock.class.getName()).log(java.util.logging. // End of variables declaration
Level.SEVERE, null, ex);
}
} catch (InstantiationException ex) {
Search_Inventory.java
java.util.logging.Logger.getLogger(Over_S /*
tock.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex); * To change this license header, choose
License Headers in Project Properties.
} catch (IllegalAccessException ex) {
* To change this template file, choose
Tools | Templates
java.util.logging.Logger.getLogger(Over_S
tock.class.getName()).log(java.util.logging. * and open the template in the editor.
Level.SEVERE, null, ex);
*/
} catch
package projectf1;
(javax.swing.UnsupportedLookAndFeelEx
ception ex) {

import java.sql.Connection;
java.util.logging.Logger.getLogger(Over_S
tock.class.getName()).log(java.util.logging. import java.sql.DriverManager;
Level.SEVERE, null, ex); import java.sql.PreparedStatement;
} import java.sql.ResultSet;
//</editor-fold> import javax.swing.JOptionPane;
import java.lang.String; //ResultSet rs=pst.executeQuery();
import java.sql.Statement; conn =
DriverManager.getConnection("jdbc:ucana
import net.proteanit.sql.DbUtils;
ccess://C:\\Users\\Noel
Portillo\\Desktop//Final Project.accdb");

/** stmt = conn.createStatement();

* rs = stmt.executeQuery("Select
Control_Number, Brand, Stocks from
* @author Noel Portillo Products where Control_Number =
*/ '"+Search1+"' or Brand = '"+Search1+"' or
Stocks = '"+Search1+"'");
public class Search_Inventory extends
javax.swing.JFrame {
tblSearch_Inventory.setModel(DbUtils.res
private Connection conn; ultSetToTableModel(rs));
public Statement stmt; new Inventory().setVisible(false);
public ResultSet rs; this.setVisible(true);
/**String Search1; rs.close();
* Creates new form Search_Inventory conn.close();
*/ }

public void Search_Inventory (String catch(Exception ex)


Search1){
{

initComponents(); JOptionPane.showMessageDialog(null,
ex);
}

try {
}

//Connection conn =
DriverManager.getConnection("jdbc:ucana
ccess://C:\\Users\\Noel
Portillo\\Desktop\\Final Project.accdb");
//String sql="select
Control_Number, Brand, Stocks from
Products where Control_Number =
'"+Search2+"' or Brand = '"+Search2+"' or /**
Stocks = '"+Search2+"'";
* This method is called from within the
//PreparedStatement constructor to initialize the form.
pst=conn.prepareStatement(sql);
* WARNING: Do NOT modify this
code. The content of this method is
Back.setText("Back");
always
Back.addActionListener(new
* regenerated by the Form Editor.
java.awt.event.ActionListener() {
*/
public void
@SuppressWarnings("unchecked") actionPerformed(java.awt.event.ActionEve
nt evt) {
// <editor-fold defaultstate="collapsed"
desc="Generated Code"> BackActionPerformed(evt);
private void initComponents() { }
});
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.GroupLayout layout =
javax.swing.JScrollPane(); new
javax.swing.GroupLayout(getContentPane
tblSearch_Inventory = new
());
javax.swing.JTable();
getContentPane().setLayout(layout);
Back = new javax.swing.JButton();
layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.Gr
setDefaultCloseOperation(javax.swing.Wi
oupLayout.Alignment.LEADING)
ndowConstants.EXIT_ON_CLOSE);

.addGroup(layout.createSequentialGroup(
jLabel1.setText("Search Results: "); )
.addContainerGap()

tblSearch_Inventory.setModel(new
javax.swing.table.DefaultTableModel( .addGroup(layout.createParallelGroup(jav
ax.swing.GroupLayout.Alignment.LEADIN
new Object [][] { G, false)

}, .addGroup(layout.createSequentialGroup(
)
new String [] {
.addComponent(jLabel1)
"Control_Number", "Brand",
"Stock"
.addPreferredGap(javax.swing.LayoutStyl
} e.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE
));
, Short.MAX_VALUE)
.addComponent(Back))
jScrollPane1.setViewportView(tblSearch_I
nventory);
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_ private void
SIZE, BackActionPerformed(java.awt.event.Acti
javax.swing.GroupLayout.DEFAULT_SIZE onEvent evt) {
,
this.setVisible(false);
javax.swing.GroupLayout.PREFERRED_
SIZE)) new Inventory().setVisible(true);
}
.addContainerGap(javax.swing.GroupLay
out.DEFAULT_SIZE,
Short.MAX_VALUE)) /**
); * @param args the command line
layout.setVerticalGroup( arguments
*/
layout.createParallelGroup(javax.swing.Gr public static void main(String args[]) {
oupLayout.Alignment.LEADING)
/* Set the Nimbus look and feel */

.addGroup(layout.createSequentialGroup( //<editor-fold defaultstate="collapsed"


) desc=" Look and feel setting code
(optional) ">
.addContainerGap()
/* If Nimbus (introduced in Java SE
6) is not available, stay with the default
.addGroup(layout.createParallelGroup(jav look and feel.
ax.swing.GroupLayout.Alignment.LEADIN
G) * For details see
http://download.oracle.com/javase/tutorial/
.addComponent(jLabel1) uiswing/lookandfeel/plaf.html
.addComponent(Back)) */
.addGap(18, 18, 18) try {
.addComponent(jScrollPane1, for
javax.swing.GroupLayout.PREFERRED_ (javax.swing.UIManager.LookAndFeelInfo
SIZE, 305, info :
javax.swing.GroupLayout.PREFERRED_ javax.swing.UIManager.getInstalledLookA
SIZE) ndFeels()) {
if
.addContainerGap(javax.swing.GroupLay ("Nimbus".equals(info.getName())) {
out.DEFAULT_SIZE,
Short.MAX_VALUE))
javax.swing.UIManager.setLookAndFeel(i
); nfo.getClassName());
break;
pack(); }
}// </editor-fold> }
} catch (ClassNotFoundException ex) private javax.swing.JTable
{ tblSearch_Inventory;
// End of variables declaration
java.util.logging.Logger.getLogger(Search
_Inventory.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Search
_Inventory.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Search
_Inventory.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
}
} catch
(javax.swing.UnsupportedLookAndFeelEx
ception ex) {

java.util.logging.Logger.getLogger(Search
_Inventory.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */

// Variables declaration - do not modify


private javax.swing.JButton Back;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane
jScrollPane1;
Edit Client

Output:
About

Add Item Edit Item

Clients Inventory
New Client

Welcome Message

Out of stock

Log In form

Over Stock

You might also like