Вы находитесь на странице: 1из 91

BHARANI VIDHYALAYA

A Project Report
on

OPTICAL STORE MANAGEMENT SYSTEM

For
AISSCE 2011 Examination
[As a part of the Informatics Practices Course (065)]

SUBMITTED BY
KEERTHANA PRIYA.K

Under the Guidance of:


Mr.Bibin Jose
PGT (Comp.Sc)
CERTIFICATE

This is to certify that the Project / Dissertation entitled

Optical store management system is a bonafide work

done by Varsha.S of class XII Session 2019-20 in

partial fulfillment of CBSE’s AISSCE Examination

2011 and has been carried out under my direct

supervision and guidance. This report or a similar

report on the topic has not been submitted for any

other examination and does not form a part of any

other course undergone by the candidate.

………………………… ……………………………..
Signature of Student Signature of Teacher/Guide

Name: ………. Name: ………………..


Roll No.: …………………… Designation: PGT (Comp.Sc.)

……….…………………
Signature of Principal
Name: ………………….
Place:…………….
Date:……………..
ACKNOWLEDGEMENT
undertook this Project work, as the part of my XII-

We Informatics Practices course.We had tried to apply my


best of knowledge and experience, gained during the
study and class work experience. However, developing software system
is generally a quite complex and time-consuming process. It requires a
systematic study, insight vision and professional approach during the
design and development. Moreover, the developer always feels the need,
the help and good wishes of the people near you, who have considerable
experience and idea.

we would like to extend my sincere thanks and gratitude to my teacher


Mr.Bibin Jose. We are very much thankful to our Principal
Dr.C.Subramanian for giving valuable time and moral support to
develop this software.

we would like to take the opportunity to extend my sincere thanks and


gratitude to our parents for being a source of inspiration and
providing time and freedom to develop this software project.

We also feel indebted to my friends for the valuable suggestions during


the project work.
1)Varsha.S
2)Nancy Merlin .D
3)subiksha.P
CONTENTS
1. Introduction ---------------------------------------------------------------- 5

2. Objective & Scope of the ProjectError! Bookmark not defined.

3. Theoretical Background------------------------------------------------ 9

4. Problem Definition & Analysis Error! Bookmark not defined.

5. System Implementation ---------------------------------------------- 12

6.1 The Hardware used: ------------------------------------------------- 12

6.2 The Softwares used: ------------------------------------------------ 12

6. System Design & Development ------------------------------------ 13

7.2 Database Design: ---------------------------------------------------- 13

7.3 Menu Design: ------------------- Error! Bookmark not defined.

7.4 I/O Forms Design & Event Coding:Error! Bookmark not defined.

7. User Manual ------------------------ Error! Bookmark not defined.

8.1 How to install: ------------------- Error! Bookmark not defined.

8.2 Working with Software: ------- Error! Bookmark not defined.

8. References ------------------------- Error! Bookmark not defined.


1. Introduction
This software project is developed to automate the functionalities of a

Optical store.The purpose of the software project is to develop the

Management Information System (MIS) to automate the record

keeping of frame details,glass details, lens details, sales details and

customer details with a view to enhance the decision making of the

functionaries.

A MIS mainly consists of a computerized database, a collection of

inter-related tables for a particular subject or purpose, capable to

produce different reports relevant to the user. An application program

is tied with the database for easy access and interface to the database.

Using Application program or front-end, we can store, retrieve and

manage all information in proper way.

This software, being simple in design and working, does not require

much of training to users, and can be used as a powerful tool for

automating an optical store system.

During coding and design of the software Project, Java NetBeans IDE,

a powerful front-end tool is used for getting Graphical User Interface

(GUI) based integrated platform and coding simplicity. As a back-end


a powerful, open source RDBMS, My SQL is used as per requirement

of the CBSE curriculum of Informatics Practices Course.


2.Scope of the Project

T he objective of the software project is to develop a computerized MIS to


automate the functions of a Optical shop. This software project is also aimed to
enhance the current record keeping system, which will help managers to retrieve the
up-to-date information at right time in right shape.
The proposed software system is expected to do the following functionality-
 To provide a user friendly, Graphical User Interface (GUI) based integrated and
centralized environment for MIS activities.
 The proposed system should maintain all the records and transactions, and
should generate the required reports and information when required.
 To provide graphical and user-friendly interface to interact with a centralized
database based on client-server architecture.
 To identify the critical operation procedure and possibilities of simplification
using modern IT tools and practices.

In its current scope, the software enables user to retrieve and update the information
from centralized database designed with MySQL . This software does not require much
training time of the users due to limited functionality and simplicity.

During the development of Optical shop Information System project, Java NetBeans
IDE, a powerful, open source event-driven form-based development environment is
used for modular design and future expandability of the system.

Despite of the best effort of the developer, the following limitations and functional
boundaries are visible, which limits the scope of this application software.

1. This software can store records and produce reports in pre-designed format in
soft copy. There is no facility yet to produce customized reports. Only specified
reports are covered.

2. There is no provision to calculate fine or penalty etc. for defaulter members;


however it can be developed easily with the help of adding modules.

3. Some application area like accounting of books and fines etc. are not
implemented in the project. It facilitates employee to record and update only
transaction record.

So far as future scope of the project is concerned, firstly it is open to any modular
expansion i.e. other modules or functions can be designed and embedded to handle the
user need in future. Any part of the software and reports can be modified independently
without much effort.
3. Theoretical Background

3.1 What is Database?


Introduction and Concepts:
A database is a collection of information related to a particular subject or purpose, such
as tracking customer orders or maintaining a music collection. Using any RDBMS
application software like MS SQL Server, MySQL, Oracle, Sybase etc, you can manage
all your information from a single database file. Within the file, divide your data into
separate storage containers called tables. You may and retrieve the data using queries.
A table is a collection of data about a specific topic, such as products or suppliers. Using
a separate table for each topic means you can store that data only once, which makes
your database more efficient and reduces data-entry errors. Table organises data into
columns (called fields) and rows (called records).
A Primary key is one or more fields whose value or values uniquely identify each record
in a table. In a relationship, a primary key is used to refer to specific record in one table
from another table. A primary key is called foreign key when it is referred to from
another table.

To find and retrieve just the data that meets conditions you specify, including data from
multiple tables, create a query. A query can also update or delete multiple records at
the same time, and perform built-in or custom calculations on your data.

Most of the database management systems have the following capabilities:


 Creating of a table, addition, deletion, modification of records.
 Retrieving data collectively or selectively.
 The data stored can be sorted or indexed at the user's discretion and direction.
 Various reports can be produced from the system..
 Mathematical functions can be performed and the data stored in the database
can be manipulated with these functions to perform the desired calculations.
 Maintains data integrity.
3.2 What is My SQL ?
The management of data in a database system is done by means of a general-purpose
software package called a Database Management System (DBMS). Some commercially
available RDBMS are MS SQL Server, MS ACCESS, INGRES, ORACLE, and Sybase.
MySQL, the most popular Open Source SQL database management system, is
developed,
distributed, and supported by Oracle Corporation.
Some of the important features of MysQL are:
 MySQL is a database management system.
 MySQL is based on SQL.
 MySQL software is Open Source.
 The MySQL Database Server is very fast, reliable, and easy to use. .
 MySQL Server works in client/server or embedded systems.
 Works on many different platforms.

3.3 What is NetBeans IDE ?


NetBeans is an integrated development environment (IDE) for Java. NetBeans runs
on Windows, macOS, Linux and Solaris. In addition to Java development, it has
extensions for other languages like PHP, C, C++, HTML5 and JavaScript.

Features of NetBeans
A free, open-source Integrated Development Environment for software developers. You
get all the tools you need to create professional desktop, enterprise, web, and mobile
applications with the Java platform, as well as C/C++, PHP, JavaScript, Groovy, and
Ruby.
4. Problem Definition & Analysis
Problem definition describes the What of a system, not How . The quality of a software
product is only as good as the process that creates it. Problem definition is one of the
most crucial steps in this creation process. Without defining a problem, developers do
not know what to build, customers do not know what to expect, and there is no way to
validate that the built system satisfies the requirement.
Problem definition and Analysis is the activity that encompasses learning about the
problem to be solved, understanding the needs of customer and users, trying to find out
who the user really is, and understanding all the constraints on the solution. It includes
all activities related to the following:
 Identification and documentation of customer’s or user’s needs.
 Creation of a document that describes the external behavior and the association
constraints that will satisfies those needs.
 Analysis and validation of the requirements documents to ensure consistency,
completeness, and feasibility
 Evolution of needs.
After the analysis of the functioning of a Optical shop system, the proposed System is
expected to do the following: -
 To provide a user friendly, Graphical User Interface (GUI) based integrated and
centralized environment for computerized Public Library System.
 The proposed system should maintain all the records and transactions, and
should generate the required reports and information when required.
 To provide efficient and secured Information storage, flow and retrieval system,
ensuring the integrity and validity of records.
 To provide graphical and user-friendly interface to interact with a centralized
database based on client-server architecture.
 To identify the critical operation procedure and possibilities of simplification
using modern IT tools and practices.
5. System Implementation

5.1 The Hardware used:

While developing the system, the used hardware are:


PC with Pentium IV processor or sometimes, PC with Celeron (1.7 GHz) processor
having 256 MB RAM, SVGA and other required devices.

5.2 The Softwares used:


 Java NetBeans 6.9 as Front-end Development environment.

 MySQL as Back-end Sever with Database for Testing.

 MS-Word 2000 for documentation.


6. System Design & Development

6.1 Database Design:


An important aspect of system design is the design of data storage structure. This
software project maintains a database named optical shop which contains the following
tables.

Table Design:
The database of optical store System contains 5 tables. The tables are normalized to
minimize the redundancies of data and enforcing the validation rules of the
organization. Most of the tables are designed to store master records. The tables and
their structure are given below.

Table: customer
Column Name Type Size
Customer_nam VARCHAR (40)
Customer_id INT (60)
Address VARCHAR (40)
Phone_no VARCHAR (10)
Email_id VARCHAR (40)
Gender VARCHAR (10)

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size
Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size
Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size
Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size

Table:
Column Name Type Size
private void adminActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frames01a al=new frames01a();
al.setVisible(true);

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


this.dispose();
frame01u sl=new frame01u();
sl.setVisible(true);
}

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


this.dispose();
}
private void exitActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frame01intro sn=new frame01intro();
sn.setVisible(true);
}

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


usrtext.setText("");
usrpass.setText("");
}

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


String username=usrtext.getText();
String password=new String(usrpass.getPassword());
if(username.equals("subi")){
if(password.equals("varsha"))
{ JOptionPane.showMessageDialog(this,"welcome to the shop");
this.dispose();
frame02u2 ns=new frame02u2();
ns.setVisible(true);}
else
{ JOptionPane.showMessageDialog(this,"your password is wrong");}
}

else
}
private void back2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}
private void homeActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frame01intro rp=new frame01intro();
rp.setVisible(true);
}

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


this.dispose();
frame03u3 oc=new frame03u3();
oc.setVisible(true);
}

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


this.dispose();
frame04u4 nc=new frame04u4();
nc.setVisible(true);
}
import java.sql.*;
import javax.swing.JOptionPane;

public class frame03u3 extends javax.swing.JFrame {


public frame03u3() {
initComponents();
}

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


this.dispose();
String cn=octext.getText();
String cno=cioctext.getText();
frame05u5 rv= new frame05u5(cn,cno);
rv.setVisible(true);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
String pn=pnoc.getText();
String q="select *from customer where phone_no='"+pn+"';";
ResultSet rs=st.executeQuery(q);
while(rs.next())
{
String cname=rs.getString("Customer_name");
octext.setText(cname);
cioctext.setText(rs.getString("Customer_id"));
ataoc.setText(rs.getString("Address"));
pnoc.setText(rs.getString("phone_no"));
eioc.setText(rs.getString("email_id"));
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
String pn=pnoc.getText();
String ad=ataoc.getText();
String ed=eioc.getText();
String q="update customer set Address='"+ad+"',email_id='"+ed+"' where
phone_no='"+pn+"';";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Record updated");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}}
import java.sql.*;

import javax.swing.JOptionPane;

public class frame04u4 extends javax.swing.JFrame {

int c_id;
public frame04u4() {
initComponents();
gencid();
}
public void gencid()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT Customer_id from customer order by Customer_id desc limit 1";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
if(rs.next())
{int c1=rs.getInt("Customer_id");
c1++;
c_id=c1;
}
else{
c_id=101;
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
citext.setText(""+c_id);
}

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


this.dispose();
String cn=nctext.getText();
String cno=citext.getText();
frame05u5 rv= new frame05u5(cn,cno);
rv.setVisible(true);
}

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


citext.setText("");
nctext.setText("");
ata.setText("");
pntxt.setText("");
eitxt.setText("");
gender.clearSelection();
}

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

String Gender="";
if (mrb.isSelected()==true)
Gender="Male";
else if(frb.isSelected()==true)
Gender="Female";
else
Gender="Transgender";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
String cnname=nctext.getText();
int id=Integer.parseInt(citext.getText());
String address =ata.getText();
String phoneno= pntxt.getText();
String emailid =eitxt.getText();
String q="Insert into customer
values('"+cnname+"',"+id+",'"+address+"','"+phoneno+"','"+emailid+"','"+Gender+"');";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Record Added");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

}
public class frame05u5 extends javax.swing.JFrame {
public frame05u5() {
initComponents();
}
public frame05u5(String s1,String s2) {
initComponents();
l1.setText(s1);
l2.setText(s2);
}

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

String cn=l1.getText();
String cno=l2.getText();
this.dispose();
frame06u6 sm=new frame06u6(cn,cno);
sm.setVisible(true);

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


String cn=l1.getText();
String cno=l2.getText();
this.dispose();
frame07u7 ap=new frame07u7(cn,cno);
ap.setVisible(true);
}

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


this.dispose();
frame01u sv=new frame01u();
sv.setVisible(true);
}

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


this.dispose();
}
import static java.awt.AWTEventMulticaster.add;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import static org.jdesktop.swingx.table.TableUtilities.clear;
public class frame06u6 extends javax.swing.JFrame {
int billno;
public frame06u6() {
initComponents();

public frame06u6(String s1, String s2) {


initComponents();

cn4.setText(s2);
fullgtable();
fullftable();
fullframe();} }

private void fullframe()


{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT Bill_no from bill order by Bill_no desc limit 1";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
int c1=rs.getInt("Bill_no");
c1++;
billno=c1;
}
else{
billno=101;
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
bn1.setText(""+billno);
}
private void fullgtable()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT * from glass_details";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
DefaultTableModel tm=(DefaultTableModel)gtable.getModel();
tm.setRowCount(0);
while(rs.next())
{
Object
o[]={rs.getInt("glass_code"),rs.getString("Types_of_Glass"),rs.getString("Coating"),rs.getDou
ble("Price"),rs.getInt("quantity")};
tm.addRow(o);
}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

}
private void fullftable()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT * from frames_details";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
DefaultTableModel tm=(DefaultTableModel)ftable.getModel();
tm.setRowCount(0);
while(rs.next())
{
Object
o[]={rs.getInt("Code_no"),rs.getString("Brand_Name"),rs.getString("Frame_Material"),rs.get
String("Color"),rs.getString("Shape_of_Frame"),rs.getDouble("Price"),rs.getInt("quantity")};
tm.addRow(o);
}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
int row=ftable.getSelectedRow();
String tc=(ftable.getModel().getValueAt(row,0).toString());
String q1="SELECT * from frames_details where Code_no='"+tc+"'";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
String tf=rs.getString("Brand_Name");
String co=rs.getString("Frame_Material");
String am=rs.getString("Shape_of_Frame");
String cc=rs.getString("Color");
int tqty=rs.getInt("quantity");
int fcode=rs.getInt("Code_no");
double tprice=rs.getDouble("Price");

}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e); }
}

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


String cno=cn4.getText();
String nu=bn1.getText();}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
int row=gtable.getSelectedRow();
String tc=(gtable.getModel().getValueAt(row,0).toString());
String q1="SELECT * from glass_details where glass_code='"+tc+"'";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
String tf=rs.getString("Types_of_Glass");
String co=rs.getString("Coating");
int tqty=rs.getInt("quantity");
double tprice=rs.getDouble("Price");
int gcode=rs.getInt("glass_code");

}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e); }
}

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


DefaultTableModel model1=(DefaultTableModel)ftable.getModel();
DefaultTableModel model2=(DefaultTableModel)ftablebill.getModel();
int [] ind=ftable.getSelectedRows();
for(int i=0;i<ind.length;i++)
{
Object[] row={model1.getValueAt(ind[i],
0),model1.getValueAt(ind[i],1),model1.getValueAt(ind[i], 2),model1.getValueAt(ind[i],
3),model1.getValueAt(ind[i],4),model1.getValueAt(ind[i],5),0,0};
model2.addRow(row);
}
}

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

private void gtablebillPropertyChange(java.beans.PropertyChangeEvent evt) {


DefaultTableModel model=(DefaultTableModel)gtablebill.getModel();
int r=gtablebill.getRowCount();
if(r==0)
return;
for(int i=0;i<r;i++)
{
float price=Float.parseFloat(model.getValueAt(i, 3).toString());
float qty=Float.parseFloat(model.getValueAt(i, 4).toString());
float totalprice=price*qty;
model.setValueAt(totalprice,i,7);
}
}

private void ftablebillPropertyChange(java.beans.PropertyChangeEvent evt) {


DefaultTableModel model=(DefaultTableModel)ftablebill.getModel();
int r=ftablebill.getRowCount();
if(r==0)
return;
for(int i=0;i<r;i++)
{
float price=Float.parseFloat(model.getValueAt(i, 5).toString());
float qty=Float.parseFloat(model.getValueAt(i, 6).toString());
float totalprice=price*qty;
model.setValueAt(totalprice,i,7);
}
}

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

try {
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();

SimpleDateFormat sd=new SimpleDateFormat("dd-MM-YYYY",Locale.getDefault());


String billdate=sd.format(bdate1.getDate());
String billno=bn1.getText();
String cid=cn4.getText();

DefaultTableModel model=(DefaultTableModel)gtablebill.getModel();
int r=gtablebill.getRowCount();
if(r==0)
return;
for(int i=0;i<r;i++)
{
int qty=Integer.parseInt(model.getValueAt(i, 4).toString());
if(qty==0)
JOptionPane.showMessageDialog(null,"quantity not inserted");
return;
}

for(int i=0;i<r;i++)
{
float tprice=Float.parseFloat(model.getValueAt(i, 7).toString());
float qty=Float.parseFloat(model.getValueAt(i, 4).toString());
float powerl=Float.parseFloat(model.getValueAt(i, 5).toString());
float powerr=Float.parseFloat(model.getValueAt(i, 6).toString());
float gcode=Float.parseFloat(model.getValueAt(i, 0).toString());

String st1="pending";
String q="Insert into bill_glass values('"+billno+"','"+billdate+"','"+cid+"','"+gcode+"'
,'"+tprice+"','"+powerr+"','"+powerl+"','"+qty+"');";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Connected");
String q1="Insert into bill values('"+billno+"','"+cid+"','"+st1+"','"+gcode+"');";
st.executeUpdate(q1);
}
JOptionPane.showMessageDialog(null,"Records Inserted");

st.close();
con.close();
}
catch (Exception ex) {
Logger.getLogger(frame06u6.class.getName()).log(Level.SEVERE, null, ex);
}
}

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


this.dispose();
frame05u5 sp=new frame05u5();
sp.setVisible(true);
}

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


try {
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();

SimpleDateFormat sd=new SimpleDateFormat("dd-MM-YYYY",Locale.getDefault());


String billdate=sd.format(bdate1.getDate());
String billno=bn1.getText();
String cid=cn4.getText();

DefaultTableModel model=(DefaultTableModel)ftablebill.getModel();
int r=ftablebill.getRowCount();
if(r==0)
return;
for(int i=0;i<r;i++)
{
int qty=Integer.parseInt(model.getValueAt(i, 6).toString());

if(qty==0)
{
JOptionPane.showMessageDialog(null,"quantity not inserted");
return;
}}
for(int i=0;i<r;i++)
{
float tprice=Float.parseFloat(model.getValueAt(i, 7).toString());
float qty=Float.parseFloat(model.getValueAt(i, 6).toString());
float fcode=Float.parseFloat(model.getValueAt(i, 0).toString());
String st1="pending";

String q="Insert into bill_frame


values('"+billno+"','"+billdate+"','"+cid+"','"+fcode+"','"+qty+"','"+tprice+"');";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Connected");
String q1="Insert into bill values('"+billno+"','"+cid+"','"+st1+"','"+fcode+"');";
st.executeUpdate(q1);
}
JOptionPane.showMessageDialog(null,"Connected");

st.close();
con.close();

} catch (Exception ex) {


Logger.getLogger(frame06u6.class.getName()).log(Level.SEVERE, null, ex);
}

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


DefaultTableModel model1=(DefaultTableModel)gtable.getModel();
DefaultTableModel model2=(DefaultTableModel)gtablebill.getModel();
int [] ind=gtable.getSelectedRows();
for(int i=0;i<ind.length;i++)
{
Object[] row={model1.getValueAt(ind[i],
0),model1.getValueAt(ind[i],1),model1.getValueAt(ind[i], 2),model1.getValueAt(ind[i], 3),0,0,0};
model2.addRow(row);
}
}
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

public class frame07u7 extends javax.swing.JFrame {


int billno;
public frame07u7() {
initComponents();
}
public frame07u7(String s1,String s2) {
initComponents();

cn2.setText(s2);
fullftable();
fullframe();

private void fullframe()


{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT Bill_no from bill order by Bill_no desc limit 1";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
int c1=rs.getInt("Bill_no");
c1++;
billno=c1;
}
else{
billno=101;
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
bn.setText(""+billno);
}
private void fullftable()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");

Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT * from lens_details";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
DefaultTableModel tm=(DefaultTableModel)ltable.getModel();
tm.setRowCount(0);
while(rs.next())
{
Object
o[]={rs.getInt("lens_code"),rs.getString("Lens_Designs"),rs.getString("Lens_Type"),rs.getStri
ng("Color"),rs.getString("Brand"),rs.getString("Disposability"),rs.getDouble("Price"),rs.getIn
t("quantity")};
tm.addRow(o);
}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

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


this.dispose();
frame05u5 sp=new frame05u5();
sp.setVisible(true);
}

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

String cno=cn2.getText();
String nu=bn.getText();

DefaultTableModel model1=(DefaultTableModel)ltable.getModel();
DefaultTableModel model2=(DefaultTableModel)ltablebill.getModel();
int [] ind=ltable.getSelectedRows();
for(int i=0;i<ind.length;i++)
{
Object[] row={model1.getValueAt(ind[i],
0),model1.getValueAt(ind[i],1),model1.getValueAt(ind[i], 2),model1.getValueAt(ind[i],
3),model1.getValueAt(ind[i], 4),model1.getValueAt(ind[i], 5),0,0,model1.getValueAt(ind[i],
8),0};
model2.addRow(row);

}
}
private void ltableMouseClicked(java.awt.event.MouseEvent evt) {
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
int row=ltable.getSelectedRow();
String tc=(ltable.getModel().getValueAt(row,0).toString());
String q1="SELECT * from lens_details where lens_code='"+tc+"'";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
String tf=rs.getString("Lens_Designs");
String lt=rs.getString("Lens_Type");
String co=rs.getString("Color");
String bd=rs.getString("Brand");
String dis=rs.getString ("Disposability");
double tprice=rs.getDouble("Price");
int lcode=rs.getInt("lens_code");
int qty=rs.getInt("quantity");

}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e); }
}

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


}

private void ltablebillKeyTyped(java.awt.event.KeyEvent evt) {

private void ltablebillPropertyChange(java.beans.PropertyChangeEvent evt) {


DefaultTableModel model=(DefaultTableModel)ltablebill.getModel();
int r=ltablebill.getRowCount();
if(r==0)
return;
for(int i=0;i<r;i++)
{
float price=Float.parseFloat(model.getValueAt(i, 6).toString());
float qty=Float.parseFloat(model.getValueAt(i, 7).toString());
float totalprice=price*qty;
model.setValueAt(totalprice,i,8);
}

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


try {
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();

SimpleDateFormat sd=new SimpleDateFormat("dd-MM-YYYY",Locale.getDefault());


String billdate=sd.format(bdate.getDate());
String billno=bn.getText();
String cid=cn2.getText();

DefaultTableModel model=(DefaultTableModel)ltablebill.getModel();
int r=ltablebill.getRowCount();
if(r==0)
return;
for(int i=0;i<r;i++)
{
int qty=Integer.parseInt(model.getValueAt(i, 9).toString());

if(qty==0)
{
JOptionPane.showMessageDialog(null,"quantity not inserted");
return;
}}
for(int i=0;i<r;i++)
{
float tprice=Float.parseFloat(model.getValueAt(i, 10).toString());
float qty=Float.parseFloat(model.getValueAt(i, 9).toString());
float lcode=Float.parseFloat(model.getValueAt(i, 0).toString());
float powerl=Float.parseFloat(model.getValueAt(i, 7).toString());
float powerr=Float.parseFloat(model.getValueAt(i, 6).toString());

String st1="pending";

String q="Insert into bill_lens


values('"+billno+"','"+billdate+"','"+cid+"','"+lcode+"','"+qty+"','"+tprice+"');";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Connected");
String q1="Insert into bill
values('"+billno+"','"+billdate+"','"+cid+"','"+st1+"','"+lcode+"');";
st.executeUpdate(q1);
}
JOptionPane.showMessageDialog(null,"Connected");

st.close();
con.close();
} catch (Exception ex) {
Logger.getLogger(frame07u7.class.getName()).log(Level.SEVERE, null, ex);
}
}
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Locale;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

public class frame08u8bglass extends javax.swing.JFrame {


String tg,co,por,pol,qt,pri;
public frame08u8bglass() {
initComponents();

}
public frame08u8bglass(String s1,String s2,String s3,String s4,String s5,String s6,String
s7,String s8,String s9, String s10) {
initComponents();
per1.setText(s1);
bdate.setText(s10);
per.setText(s2);
qn.setText(s3);
this.tg=s4;
this.co=s5;
this.por=s6;
this.pol=s7;
this.qt=s8;
this.pri=s9;

ftable();
}
private void initComponents() {

jPanel2 = new javax.swing.JPanel();


jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
back = new javax.swing.JButton();
per1 = new javax.swing.JTextField();
bill = new javax.swing.JButton();
jLabel14 = new javax.swing.JLabel();
bdate = new javax.swing.JTextField();
qn = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
per = new javax.swing.JTextField();
exit = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
gtable = new javax.swing.JTable();
jLabel4 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jPanel2.setBackground(new java.awt.Color(196, 224, 238));


jPanel2.setForeground(new java.awt.Color(179, 210, 255));

jLabel2.setFont(new java.awt.Font("Rockwell", 1, 24)); // NOI18N


jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Bill glass");

jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/shop
copy1234.jpg"))); // NOI18N
jLabel3.setText("jLabel3");

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);


jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 193,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 504,
Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 239,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(52, 52, 52))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);

jPanel3.setLayout(null);
jLabel5.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N
jLabel5.setForeground(new java.awt.Color(51, 0, 51));
jLabel5.setText("Customer Name");
jPanel3.add(jLabel5);
jLabel5.setBounds(210, 170, 190, 50);

back.setBackground(new java.awt.Color(255, 204, 204));


back.setFont(new java.awt.Font("Lucida Sans", 1, 24)); // NOI18N
back.setForeground(new java.awt.Color(0, 51, 51));
back.setText("Back");
back.setToolTipText("");
back.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 4, true));
back.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
backActionPerformed(evt);
}
});
jPanel3.add(back);
back.setBounds(350, 420, 150, 60);
jPanel3.add(per1);
per1.setBounds(430, 180, 290, 40);

bill.setBackground(new java.awt.Color(255, 204, 204));


bill.setFont(new java.awt.Font("Lucida Sans", 1, 24)); // NOI18N
bill.setForeground(new java.awt.Color(0, 51, 51));
bill.setText("Bill");
bill.setToolTipText("");
bill.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 4, true));
bill.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
billActionPerformed(evt);
}
});
jPanel3.add(bill);
bill.setBounds(90, 420, 150, 60);

jLabel14.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel14.setForeground(new java.awt.Color(51, 0, 51));
jLabel14.setText("Bill No");
jPanel3.add(jLabel14);
jLabel14.setBounds(30, 10, 170, 50);
jPanel3.add(bdate);
bdate.setBounds(820, 0, 140, 40);

qn.setFont(new java.awt.Font("Kozuka Gothic Pro M", 1, 24)); // NOI18N


jPanel3.add(qn);
qn.setBounds(120, 10, 150, 40);

jLabel8.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel8.setForeground(new java.awt.Color(51, 0, 51));
jLabel8.setText("Bill Date");
jPanel3.add(jLabel8);
jLabel8.setBounds(690, 0, 110, 50);
jPanel3.add(per);
per.setBounds(420, 120, 290, 40);

exit.setBackground(new java.awt.Color(255, 204, 204));


exit.setFont(new java.awt.Font("Lucida Sans", 1, 24)); // NOI18N
exit.setForeground(new java.awt.Color(0, 51, 51));
exit.setText("exit");
exit.setToolTipText("");
exit.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 4, true));
exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitActionPerformed(evt);
}
});
jPanel3.add(exit);
exit.setBounds(570, 420, 150, 60);

jLabel1.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel1.setForeground(new java.awt.Color(51, 0, 51));
jLabel1.setText("Customer Id");
jPanel3.add(jLabel1);
jLabel1.setBounds(220, 120, 170, 50);

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

},
new String [] {
"Type Glass", "coating", "pow R", "pow L", "qty", "price"
}
){
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.String.class, java.lang.String.class
};

public Class getColumnClass(int columnIndex) {


return types [columnIndex];
}
});
jScrollPane1.setViewportView(gtable);

jPanel3.add(jScrollPane1);
jScrollPane1.setBounds(160, 290, 630, 90);

jLabel4.setForeground(new java.awt.Color(0, 51, 51));


jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/OpticalShopFour
copy111222.jpg"))); // NOI18N
jLabel4.setText("jLabel4");
jPanel3.add(jLabel4);
jLabel4.setBounds(20, 0, 1000, 750);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());


getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 1015, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(15, 15, 15)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 1003,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 850, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 679,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)))
);

pack();
}

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


this.dispose();
frame05u5 sp=new frame05u5();
sp.setVisible(true);
}

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

try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop","root"
,"123456");
JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
String cname = per1.getText();
String billdate=bdate.getText();
String billno=qn.getText();
String cid=per.getText();
String st1="pending";
String q="Insert into bill_glass
values('"+billno+"','"+billdate+"','"+cid+"','"+cname+"','"+
tg+"','"+co+"','"+por+"','"+pol+"','"+qt+"','"+pri+"','"+st1+"');";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Connected");
String q1="Insert into bill
values('"+billno+"','"+billdate+"','"+cid+"','"+cname+"','"+st1+"','"+pri+"');";
st.executeUpdate(q1);
JOptionPane.showMessageDialog(null,"Connected");

st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

}
void ftable()
{

DefaultTableModel tm=(DefaultTableModel)gtable.getModel();
tm.addRow(new Object[]{tg,co,por,pol,qt,pri});

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


this.dispose();
frame01intro sn=new frame01intro();
sn.setVisible(true);
}
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Locale;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

public class frame09u9bframe extends javax.swing.JFrame {


String tg,co,por,pol,qt,pri;
public frame09u9bframe() {
initComponents();
}
public frame09u9bframe(String s1,String s2,String s3,String s4,String s5,String
s6,String s7,String s8,String s9, String s10) {
initComponents();
per1.setText(s1);
bdate.setText(s10);
per.setText(s2);
qn.setText(s3);
this.tg=s4;
this.co=s5;
this.por=s6;
this.pol=s7;
this.qt=s8;
this.pri=s9;

ftable();
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cname = per1.getText();
String billdate=bdate.getText();
String billno=qn.getText();
String cid=per.getText();
String st1="pending";

String q="Insert into bill_frame


values('"+billno+"','"+billdate+"','"+cid+"','"+cname+"','"+
tg+"','"+co+"','"+por+"','"+pol+"','"+qt+"','"+pri+"','"+st1+"');";
st.executeUpdate(q);
String q1="Insert into bill
values('"+billno+"','"+billdate+"','"+cid+"','"+cname+"','"+st1+"','"+pri+"');";
st.executeUpdate(q1);
JOptionPane.showMessageDialog(null,"added");

st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
void ftable()
{

DefaultTableModel tm=(DefaultTableModel)ftable.getModel();
tm.addRow(new Object[]{tg,co,por,pol,qt,pri});

}
private void exitActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frame01intro sn=new frame01intro();
sn.setVisible(true);
}
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Locale;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

public class frame10u10blens extends javax.swing.JFrame {


String cn,cno,bn,ld,lt,co,br,dis,por,pol,qty,pr;
public frame10u10blens() {
initComponents();
}
public frame10u10blens(String cn,String cno,String bino,String s1,String s2,String
s3,String s4,String s5,String s6, String s7,String s8,String s9, String s10) {
initComponents();
billno.setText(bino);
bdate.setText(s10);
cname.setText(cn);
cid.setText(cno);
this.ld=s1;
this.lt=s2;
this.co=s3;
this.br=s4;
this.dis=s5;
this.por=s6;
this.pol=s7;
this.qty=s8;
this.pr=s9;
ftable();
}
void ftable()
{
DefaultTableModel tm=(DefaultTableModel)ltable.getModel();
tm.addRow(new Object[]{ld,lt,co,br,dis,por,pol,qty,pr});

private void initComponents() {

jPanel2 = new javax.swing.JPanel();


jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
back = new javax.swing.JButton();
cname = new javax.swing.JTextField();
bill = new javax.swing.JButton();
jLabel14 = new javax.swing.JLabel();
bdate = new javax.swing.JTextField();
billno = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
cid = new javax.swing.JTextField();
exit = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
ltable = new javax.swing.JTable();
jLabel4 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jPanel2.setBackground(new java.awt.Color(196, 224, 238));


jPanel2.setForeground(new java.awt.Color(179, 210, 255));

jLabel2.setFont(new java.awt.Font("Rockwell", 1, 24)); // NOI18N


jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Bill lens");

jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/shop
copy1234.jpg"))); // NOI18N
jLabel3.setText("jLabel3");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 193,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 504,
Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 239,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(52, 52, 52))
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);

jPanel3.setLayout(null);

jLabel5.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel5.setForeground(new java.awt.Color(51, 0, 51));
jLabel5.setText("Customer Name");
jPanel3.add(jLabel5);
jLabel5.setBounds(210, 170, 190, 50);

back.setBackground(new java.awt.Color(255, 204, 204));


back.setFont(new java.awt.Font("Lucida Sans", 1, 24)); // NOI18N
back.setForeground(new java.awt.Color(0, 51, 51));
back.setText("Back");
back.setToolTipText("");
back.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 4,
true));
back.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
backActionPerformed(evt);
}
});
jPanel3.add(back);
back.setBounds(290, 390, 150, 60);
jPanel3.add(cname);
cname.setBounds(430, 180, 290, 40);

bill.setBackground(new java.awt.Color(255, 204, 204));


bill.setFont(new java.awt.Font("Lucida Sans", 1, 24)); // NOI18N
bill.setForeground(new java.awt.Color(0, 51, 51));
bill.setText("Bill");
bill.setToolTipText("");
bill.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 4,
true));
bill.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
billActionPerformed(evt);
}
});
jPanel3.add(bill);
bill.setBounds(60, 390, 150, 60);

jLabel14.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel14.setForeground(new java.awt.Color(51, 0, 51));
jLabel14.setText("Bill No");
jPanel3.add(jLabel14);
jLabel14.setBounds(30, 10, 170, 50);
jPanel3.add(bdate);
bdate.setBounds(820, 0, 140, 40);

billno.setFont(new java.awt.Font("Kozuka Gothic Pro M", 1, 24)); // NOI18N


jPanel3.add(billno);
billno.setBounds(120, 10, 150, 40);

jLabel8.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel8.setForeground(new java.awt.Color(51, 0, 51));
jLabel8.setText("Bill Date");
jPanel3.add(jLabel8);
jLabel8.setBounds(690, 0, 110, 50);
jPanel3.add(cid);
cid.setBounds(420, 120, 290, 40);

exit.setBackground(new java.awt.Color(255, 204, 204));


exit.setFont(new java.awt.Font("Lucida Sans", 1, 24)); // NOI18N
exit.setForeground(new java.awt.Color(0, 51, 51));
exit.setText("exit");
exit.setToolTipText("");
exit.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 4,
true));
exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitActionPerformed(evt);
}
});
jPanel3.add(exit);
exit.setBounds(530, 390, 150, 60);

jLabel1.setFont(new java.awt.Font("Kozuka Mincho Pro H", 1, 24)); // NOI18N


jLabel1.setForeground(new java.awt.Color(51, 0, 51));
jLabel1.setText("Customer Id");
jPanel3.add(jLabel1);
jLabel1.setBounds(220, 120, 170, 50);

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

},
new String [] {
"lens_design", "lens_type", "color", "Brand", "Disposability", "pow R",
"pow L", "qty", "price"
}
){
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.String.class, java.lang.String.class
};

public Class getColumnClass(int columnIndex) {


return types [columnIndex];
}
});
jScrollPane1.setViewportView(ltable);

jPanel3.add(jScrollPane1);
jScrollPane1.setBounds(140, 260, 750, 90);

jLabel4.setForeground(new java.awt.Color(0, 51, 51));


jLabel4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/OpticalShopFour copy111222.jpg")));
jLabel4.setText("jLabel4");
jPanel3.add(jLabel4);
jLabel4.setBounds(20, 0, 1000, 750);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 1015, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(15, 15, 15)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
1003, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 850, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
679, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)))
);

pack();
}

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


}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cn = cname.getText();
String billdate=bdate.getText();
String bilno=billno.getText();
String cuid=cid.getText();
String st1="pending";

String q="Insert into bill_lens


values('"+bilno+"','"+billdate+"','"+cn+"','"+cuid+"','"+
ld+"','"+lt+"','"+co+"','"+br+"','"+dis+"','"+por+"','"+pol+"','"+qty+"','"+pr+"','"+
st1+"');";
st.executeUpdate(q);
String q1="Insert into bill
values('"+bilno+"','"+billdate+"','"+cuid+"','"+cn+"','"+st1+"','"+pr+"');";
st.executeUpdate(q1);
JOptionPane.showMessageDialog(null,"Connected");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}

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


this.dispose();
frame01intro sn=new frame01intro();
sn.setVisible(true);
}
private void admlogActionPerformed(java.awt.event.ActionEvent evt) {
String adminname=admtext.getText();
String password=new String(admpass.getPassword());
if(adminname.equals("nancy")){
if(password.equals("keeru")){
JOptionPane.showMessageDialog(this,"welcome to the shop");
this.dispose();
frames02a2 an=new frames02a2();
an.setVisible(true);
}}
else
JOptionPane.showMessageDialog(this,"your username or password is wrong");

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


admtext.setText("");
admpass.setText("");
}

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


this.dispose();
frame01intro sn=new frame01intro();
sn.setVisible(true);
}
private void backActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frame01intro sv=new frame01intro();
sv.setVisible(true);
}

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


this.dispose();
frames04a4 ap=new frames04a4();
ap.setVisible(true);
}

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


this.dispose();
frames03a3 nm=new frames03a3();
nm.setVisible(true);
}

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


this.dispose();
frames05a5 sa=new frames05a5();
sa.setVisible(true);
}

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


this.dispose();
frames07a7 asd=new frames07a7();
asd.setVisible(true);
}
private void salesActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frames06a6b ad=new frames06a6b();
ad.setVisible(true);
}
import java.sql.*;
import javax.swing.JOptionPane;
public class frames03a3 extends javax.swing.JFrame {
int c_id; int del;
public frames03a3() {
initComponents();
fcb.setVisible(false);
}

private void fullframe()


{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT Code_no from frames_details order by Code_no desc limit
1";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
int c1=rs.getInt("Code_no");
c1++;
c_id=c1;
}
else{
c_id=101;
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn5.setText(""+c_id);
}

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


this.dispose();
frames02a2 sn=new frames02a2();
sn.setVisible(true);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String bname=qn1.getText();
String frm=qn2.getText();
String shop=qn3.getText();
String color=qn4.getText();
int code=Integer.parseInt(qn5.getText());
int qty=Integer.parseInt(qn6.getText());
double price=Double.parseDouble(qn.getText());
String q="Insert into frames_details
values('"+bname+"','"+frm+"','"+shop+"','"+color+"',"+price+","+code+","+qty+");
";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Records Inserted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedItem("");
}

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


qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedItem("");
qn5.setVisible(true);
fcb.setVisible(false);
fullframe();

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


qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedItem("");
qn5.setVisible(false);
fcb.setVisible(true);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT Code_no from frames_details";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{
String cnm=rs.getString("Code_no");
fcb.addItem(cnm);

}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
del=fcb.getSelectedIndex();
int code=Integer.parseInt(qn5.getText());
String q="Delete from frames_details where Code_no="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"Record Deleted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.removeItemAt(del);
fcb.setSelectedIndex(0);}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
String bname=qn1.getText();
String frm=qn2.getText();
String shop=qn3.getText();
String color=qn4.getText();
int code=Integer.parseInt(qn5.getText());
int qty=Integer.parseInt(qn6.getText());
double price=Double.parseDouble(qn.getText());
String q="Update frames_details set
Brand_Name='"+bname+"',Frame_Material='"+frm+"',Shape_of_Frame='"+shop+"',
Color='"+color+"',Price="+price+",quantity="+qty+" where Code_no="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"Records Updated");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedIndex(0);
}
private void back2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();}
private void fcbActionPerformed(java.awt.event.ActionEvent evt) {
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cd=fcb.getSelectedItem().toString();
int cd1=Integer.parseInt(cd);
qn5.setText(""+cd1);

String q="select *from frames_details where Code_no="+cd+";";


ResultSet rs=st.executeQuery(q);
while(rs.next())
{ String price=rs.getString("Price");
String bname=rs.getString("Brand_Name");
String fmt=rs.getString("Frame_Material");
String sf=rs.getString("Shape_of_Frame");
String cor=rs.getString("Color");
int qty=rs.getInt("quantity");
qn1.setText(bname);
qn2.setText(fmt);
qn3.setText(sf);
qn4.setText(cor);
qn.setText(price);
qn6.setText(""+qty);}
st.close();
con.close();
}
catch(Exception e)
{//JOptionPane.showMessageDialog(null,e);
}}
import java.sql.*;
import javax.swing.JOptionPane;
public class frames04a4 extends javax.swing.JFrame {
int c_id;int del;
public frames04a4() {
initComponents();
}
private void fullframe()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT lens_code from lens_details order by lens_code desc limit 1";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
int c1=rs.getInt("lens_code");
c1++;
c_id=c1;
}
else{
c_id=101;
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn6.setText(""+c_id);
}
private void addActionPerformed(java.awt.event.ActionEvent evt) {

try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
// JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
String ld=qn1.getText();
String lt=qn2.getText();
String cc=qn3.getText();
String bd=qn4.getText();
String ds=qn5.getText();
int code=Integer.parseInt(qn6.getText());
int qty=Integer.parseInt(qn7.getText());
double price=Double.parseDouble(qn.getText());
String q="Insert into lens_details
values('"+ld+"','"+lt+"','"+cc+"','"+bd+"','"+ds+"',"+price+","+code+","+qty+");";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Inserted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
ldc.setSelectedIndex(0);
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");

}
private void backActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frames02a2 sp=new frames02a2();
sp.setVisible(true);
}

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

qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
// JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
String cd=ldc.getSelectedItem().toString();
int cd1=Integer.parseInt(cd);
qn6.setText(""+cd1);

String q="select *from lens_details where lens_code="+cd+";";


ResultSet rs=st.executeQuery(q);
while(rs.next())
{ String price=rs.getString("Price");
String bname=rs.getString("Lens_Designs");
String fmt=rs.getString("Lens_Type");
String sf=rs.getString("Brand");
String cor=rs.getString("Color");
String dis=rs.getString("Disposability");
int qty=rs.getInt("quantity");
qn1.setText(bname);
qn2.setText(fmt);
qn3.setText(cor);
qn4.setText(sf);
qn5.setText(dis);
qn.setText(price);
qn7.setText(""+qty);

}
st.close();
con.close();
}
catch(Exception e)
{//JOptionPane.showMessageDialog(null,e);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
del=ldc.getSelectedIndex();
int code=Integer.parseInt(qn6.getText());
String q="Delete from lens_details where lens_code="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"Records Deleted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");
ldc.removeItemAt(del);
ldc.setSelectedIndex(0);
}
private void old_productActionPerformed(java.awt.event.ActionEvent evt) {
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");

ldc.setSelectedIndex(0);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
// JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT lens_code from lens_details";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{
String cnm=rs.getString("lens_code");
ldc.addItem(cnm);

}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

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


qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");
ldc.setSelectedIndex(0);
qn5.setVisible(true);
ldc.setVisible(false);
fullframe();

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
String bname=qn1.getText();
String frm=qn2.getText();
String cc=qn3.getText();
String bd=qn4.getText();
String dis=qn5.getText();
int code=Integer.parseInt(qn6.getText());
int qty=Integer.parseInt(qn7.getText());
double price=Double.parseDouble(qn.getText());
String q="Update lens_details set
Lens_Designs='"+bname+"',Lens_Type='"+frm+"',Color='"+cc+"',Brand='"+bd+"',D
isposability='"+dis+"',Price="+price+",quantity="+qty+" where
lens_code="+code+"";
pst=con.prepareStatement(q);
pst.execute();
// int updateCount=pst.executeUpdate();
JOptionPane.showMessageDialog(null,"Records Updated");
st.close();
con.close();

}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");
ldc.setSelectedIndex(0);
}
import java.sql.*;
import javax.swing.JOptionPane;
public class frames05a5 extends javax.swing.JFrame {
int c_id; int del;
public frames05a5() {
initComponents();
}
private void fullframe()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q1="SELECT glass_code from glass_details order by glass_code desc limit
1";
pst =con.prepareStatement(q1);
rs= pst.executeQuery();
if(rs.next())
{
int c1=rs.getInt("glass_code");
c1++;
c_id=c1;
}
else{
c_id=101;
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn5.setText(""+c_id);
}
private void back2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
String bname=qn1.getText();
String frm=qn2.getText();

int code=Integer.parseInt(qn5.getText());
int qty=Integer.parseInt(qn6.getText());
double price=Double.parseDouble(qn.getText());
String q="Update glass_details set
Types_of_Glass='"+bname+"',Coating='"+frm+"',Price="+price+",quantity="+qty+"
where glass_code="+code+"";
pst=con.prepareStatement(q);
pst.execute();
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedIndex(0);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
// JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
del=fcb.getSelectedIndex();
int code=Integer.parseInt(qn5.getText());
String q="Delete from glass_details where Code_no="+code+"";
pst=con.prepareStatement(q);
pst.execute();

JOptionPane.showMessageDialog(null,"Record deleted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.removeItemAt(del);
fcb.setSelectedIndex(0);
}

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

qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");

fcb.setSelectedIndex(0);

try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT glass_code from glass_details";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{
String cnm=rs.getString("glass_code");
fcb.addItem(cnm);

}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}}

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


qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");

fcb.setSelectedIndex(0);
qn5.setVisible(true);
fcb.setVisible(false);
fullframe();

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


this.dispose();
frames02a2 sn=new frames02a2();
sn.setVisible(true);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
String tof=qn1.getText();
String coa=qn2.getText();
int code=Integer.parseInt(qn5.getText());
int qty=Integer.parseInt(qn6.getText());
double price=Double.parseDouble(qn.getText());
String q="Insert into glass_details
values('"+tof+"','"+coa+"',"+price+","+code+","+qty+");";
st.executeUpdate(q);
JOptionPane.showMessageDialog(null,"Records Inserted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedIndex(0);
}

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


qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");

try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cd=fcb.getSelectedItem().toString();
int cd1=Integer.parseInt(cd);
qn5.setText(""+cd1);

String q="select *from glass_details where glass_code="+cd+";";


ResultSet rs=st.executeQuery(q);
while(rs.next())
{ String price=rs.getString("Price");
String bname=rs.getString("Types_of_Glass");
String fmt=rs.getString("Coating");
int qty=rs.getInt("quantity");
qn1.setText(bname);
qn2.setText(fmt);
qn.setText(price);
qn6.setText(""+qty);
}

st.close();
con.close();
}
catch(Exception e)
{//JOptionPane.showMessageDialog(null,e);
}
}
import java.sql.*;
import javax.swing.JOptionPane;
public class frames06a6b extends javax.swing.JFrame {
public frames06a6b() {
initComponents();
getbillno();
}
private void back2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();

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


this.dispose();
frames02a2 sn=new frames02a2();
sn.setVisible(true);

}
public void getbillno()
{

try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT Bill_no from bill";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{
String cnm=rs.getString("Bill_no");
fcb.addItem(cnm);

}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
String cd=fcb.getSelectedItem().toString();
String stu="Delivered";
String q="Update bill set Status='"+stu+"' where Bill_no="+cd+"";
pst=con.prepareStatement(q);
pst.execute();
String q1="Update bill_frame set Status='"+stu+"' where Bill_no="+cd+"";
pst=con.prepareStatement(q1);
pst.execute();
String q2="Update bill_lens set status='"+stu+"' where bill_no="+cd+"";
pst=con.prepareStatement(q2);
pst.execute();
String q3="Update bill_glass set Status='"+stu+"' where Bill_no="+cd+"";
pst=con.prepareStatement(q3);
pst.execute();
JOptionPane.showMessageDialog(null,"Record Updated");
st.close();
con.close();}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
private void fcbActionPerformed(java.awt.event.ActionEvent evt) {
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cd=fcb.getSelectedItem().toString();
String q="select *from bill where Bill_no="+cd+";";
ResultSet rs=st.executeQuery(q);
while(rs.next())
{
String bdat=rs.getString("Bill_Date");
String cio=rs.getString("Customer_id");

bd.setText(bdat);
ci.setText(cio);
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}}
private void backActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frames01a sv=new frames01a();
sv.setVisible(true);
}

private void Purchase_contact_lensActionPerformed(java.awt.event.ActionEvent evt)


{
this.dispose();
frames10a10 ap=new frames10a10();
ap.setVisible(true);
}

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


this.dispose();
frames08a8 nm=new frames08a8();
nm.setVisible(true);
}

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


this.dispose();
frames09a9 sa=new frames09a9();
sa.setVisible(true);
}
import java.sql.*;
import javax.swing.JOptionPane;
public class frames08a8 extends javax.swing.JFrame {
int del;
public frames08a8() {
initComponents();
fullframe();
}
private void fullframe(){
qn5.setVisible(false);
fcb.setVisible(true);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT glass_code from glass_details";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{
String cnm=rs.getString("glass_code");
fcb.addItem(cnm);

}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
private void back2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}

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


this.dispose();
frames02a2 sn=new frames02a2();
sn.setVisible(true);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
del= fcb.getSelectedIndex();
int code=Integer.parseInt(qn5.getText());
String q="Delete from glass_details where Code_no="+code+"";
pst=con.prepareStatement(q);
pst.execute();
// int updateCount=pst.executeUpdate();
JOptionPane.showMessageDialog(null,"Records Deleted");
st.close();
con.close();
}
catch(Exception e)
{//JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.removeItemAt(del);
fcb.setSelectedIndex(0);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
String bname=qn1.getText();
String frm=qn2.getText();

int code=Integer.parseInt(qn5.getText());
int qty=Integer.parseInt(qn6.getText());
double price=Double.parseDouble(qn.getText());
String q="Update glass_details set
Types_of_Glass='"+bname+"',Coating='"+frm+"',Price="+price+",quantity="+qty+"
where glass_code="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"Records Updated");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
} qn1.setText("");
qn2.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedIndex(0);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cd=fcb.getSelectedItem().toString();
int cd1=Integer.parseInt(cd);
qn5.setText(""+cd1);

String q="select *from glass_details where glass_code="+cd+";";


ResultSet rs=st.executeQuery(q);
while(rs.next())
{ String price=rs.getString("Price");
String bname=rs.getString("Types_of_Glass");
String fmt=rs.getString("Coating");
int qty=rs.getInt("quantity");
qn1.setText(bname);
qn2.setText(fmt);
qn.setText(price);
qn6.setText(""+qty);
}
//JOptionPane.showMessageDialog(null,"Connected");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
import java.sql.*;
import javax.swing.JOptionPane;
ublic class frames09a9 extends javax.swing.JFrame {
int c_id; int del;
public frames09a9() {
initComponents();
fullframe();
}
private void fullframe(){
qn5.setVisible(false);
fcb.setVisible(true);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT Code_no from frames_details";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{
String cnm=rs.getString("Code_no");
fcb.addItem(cnm);
}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
private void back2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
String bname=qn1.getText();
String frm=qn2.getText();
String shop=qn3.getText();
String color=qn4.getText();
int code=Integer.parseInt(qn5.getText());
int qty=Integer.parseInt(qn6.getText());
double price=Double.parseDouble(qn.getText());
String q="Update frames_details set
Brand_Name='"+bname+"',Frame_Material='"+frm+"',Shape_of_Frame='"+shop+"',
Color='"+color+"',Price="+price+",quantity="+qty+" where Code_no="+code+"";
pst=con.prepareStatement(q);
pst.execute();
// int updateCount=pst.executeUpdate();
JOptionPane.showMessageDialog(null,"update record");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.setSelectedIndex(0);
}
private void deleteActionPerformed(java.awt.event.ActionEvent evt) {
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
del=fcb.getSelectedIndex();
int code=Integer.parseInt(qn5.getText());
String q="Delete from frames_details where Code_no="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"record delete");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn.setText("");
fcb.removeItemAt(del);
fcb.setSelectedIndex(0);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
String cd=fcb.getSelectedItem().toString();
int cd1=Integer.parseInt(cd);
qn5.setText(""+cd1);
String q="select *from frames_details where Code_no="+cd+";";
ResultSet rs=st.executeQuery(q);
while(rs.next())
{ String price=rs.getString("Price");
String bname=rs.getString("Brand_Name");
String fmt=rs.getString("Frame_Material");
String sf=rs.getString("Shape_of_Frame");
String cor=rs.getString("Color");
int qty=rs.getInt("quantity");
qn1.setText(bname);
qn2.setText(fmt);
qn3.setText(sf);
qn4.setText(cor);
qn.setText(price);
qn6.setText(""+qty);

}
st.close();
con.close();
}
catch(Exception e)
{//JOptionPane.showMessageDialog(null,e);
}

}
private void backActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frames02a2 sn=new frames02a2();
sn.setVisible(true);
}
import java.sql.*;
import javax.swing.JOptionPane;
public class frames10a10 extends javax.swing.JFrame {
int del;
public frames10a10() {
initComponents();
fullframe();
}
private void fullframe(){
qn6.setVisible(false);
ldc.setVisible(true);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
Statement st=con.createStatement();
PreparedStatement pst=null;
ResultSet rs;
String q="SELECT lens_code from lens_details";
pst =con.prepareStatement(q);
rs= pst.executeQuery();
while(rs.next())
{ String cnm=rs.getString("lens_code");
ldc.addItem(cnm);
}
rs.close();
}

catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
private void deleteActionPerformed(java.awt.event.ActionEvent evt) {
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
del=ldc.getSelectedIndex();
int code=Integer.parseInt(qn6.getText());
String q="Delete from lens_details where lens_code="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"record deleted");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}

qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");
ldc.removeItemAt(del);
ldc.setSelectedIndex(0);
}

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


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
String cd=ldc.getSelectedItem().toString();
int cd1=Integer.parseInt(cd);
qn6.setText(""+cd1);

String q="select *from lens_details where lens_code="+cd+";";


ResultSet rs=st.executeQuery(q);
while(rs.next())
{ String price=rs.getString("Price");
String bname=rs.getString("Lens_Designs");
String fmt=rs.getString("Lens_Type");
String sf=rs.getString("Brand");
String cor=rs.getString("Color");
String dis=rs.getString("Disposability");
int qty=rs.getInt("quantity");
qn1.setText(bname);
qn2.setText(fmt);
qn3.setText(cor);
qn4.setText(sf);
qn5.setText(dis);
qn.setText(price);
qn7.setText(""+qty);
}
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
}
private void updateActionPerformed(java.awt.event.ActionEvent evt) {
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ozzerve_optical_shop
","root","123456");
//JOptionPane.showMessageDialog(null,"Connected");
Statement st=con.createStatement();
PreparedStatement pst=null;
String bname=qn1.getText();
String frm=qn2.getText();
String cc=qn3.getText();
String bd=qn4.getText();
String dis=qn5.getText();
int code=Integer.parseInt(qn6.getText());
int qty=Integer.parseInt(qn7.getText());
double price=Double.parseDouble(qn.getText());
String q="Update lens_details set
Lens_Designs='"+bname+"',Lens_Type='"+frm+"',Color='"+cc+"',Brand='"+bd+"',D
isposability='"+dis+"',Price="+price+",quantity="+qty+" where
lens_code="+code+"";
pst=con.prepareStatement(q);
pst.execute();
JOptionPane.showMessageDialog(null,"Record Updated");
st.close();
con.close();
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e);
}
qn1.setText("");
qn2.setText("");
qn3.setText("");
qn4.setText("");
qn5.setText("");
qn6.setText("");
qn7.setText("");
qn.setText("");
ldc.setSelectedIndex(0);
}
private void backActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
frames02a2 sp=new frames02a2();
sp.setVisible(true);
}

Вам также может понравиться