SlideShare a Scribd company logo
KENDRIYA VIDYALAYA
NO.1
CANTT SHAHJAHANPUR
INFORMATICSPRACTICES
PROJECTWORK
2014-15
Submit t ed t o:- MISS.GAURI GUSAIN
Submit t ed by miss:- kuma r i bha vna
CLASS:- XII “COMMERCE”
ROLLNO:-
Pgt I.P
INDEX
S .no T opic
1 Acknowledgement
2 Certificate
3 Cover P age
4 Visual M obile
oTechnology Used
5 P roject Design
6 I nterface(M obile.java)
7 M obile.java(start S creen)
Main Menu
Dial Panel
Dial Panel2
Save Panel
ContactsPanel
LogPanel
Notes Panel
EditnotesPanel
Calculator(calcPanel)
Ima ge Pa nel
Ful l view Of Sel ect ed
Ima ge(ima gepa nel 2)
8 Code
9 DatabaseS tructure
Callregister
Contacts Table
Notes Table
CERTIFICATE
SUCCESSFULLYCOMPLETEHIS/ HERPROJECT
UNDERMYGUIDANCE.SHEHASTAKENPROPER
CAREANDSHOWNATMOSTSINCERITYIN
COMPLETIONOFTHIS PROJECT.
I CERTIFYTHATTHIS PROJECTIS UPTOMY
EXPECTATIONANDAS PERTHELATEST
GUIDELINESISSUEDBYCBSEDEHRADUN.
THIS ISTOCERTIFYTHATMR./ MISS KUMARI
BHAVNASTUDENT
OFCLASS XII OF
...KENDRIYA..VIDYALAYA..NO.1..CANTT..S.P.N SCHOOL
DATE TEACHERSIGNATURE
Acknowledgem
entI gratefully acknowledge the valuable
guidance and support given to me by my
informatics practices teacher
Mr./Mrs.….Gauri Gusain……in successfully
completing my project report. This project gave
me a clear insight into real world business
situations and gave me ample opportunities to
apply my theoretical knowledge to practical
situations. I would also like to thank my
classmates for their suggestion and support in
completing this project
VISUAL
MOBILE
INTRODUCTION
This project simulates the functionally of a
mobile set visually though java swing
programming. This projects USES DATA BASE
CONNECTIVITY to store call details contact details.
etc. in a MySQL database.
TECHNOLOGY USED
Front end: Java Swing
Back end: MySQL
Project Design
This project consist of a single interface(Mobile.java) that
simulates the functionally of a mobile set using many pictures
and a database as evident from its Project window shown
below;
INTERFACE (Mobile. Java)
The Mobile. Java Interface Has Been Divided Into Two
Parts;
Upper Panel
Keypad Panel
i.e., Where Lower Panel Is Keypad Panel Which Is Visible
All The Time. The Upper Panel Changes As Per The
Function Chosen E.g., It Displays Dial Panel, save Panel,
contact Panel, notes Panel, calculator Panel Etc.
The upper panel itself is divided into tow parts.
Top Panel
<Function>Panel
A sample upper panel is shown below:
There are various function panels e.g., Dial panel, Save panel,
Calculator panel, notes panel etc. in the projects that have
been stored inside TopPanel and these lie over one another
with the help of cardLayout.
1.MOBILE.JAVA
(START SCREEN)
Before Listing The Code, it Is Important To Understand The
Functioning Of The Interface, which Is Being Explained
Below With The Help Of Screen Shots.
CODE :
import java.sql.*;
import javax.swing.JOptionPane;
import java.text.*;
import javax.swing.ImageIcon;
public class Mobile extends javax.swing.JFrame {
//Global Variables
int index = 1; //for iterating through contacts
int index2 = 1; //for iterationg through notes
int index3 = 1; //for adding new notes
int index4 = 1; //for calculator
/**Constructor*/
public Mobile() {
initcomponents();
MainPanel.setVisible(true);
DailPanel.setVisible(false);
DailPanel.setVisible(false);
SavePanel.setVisible(false);
ContactPanel.setVisible(false);
LogPanel.setVisible(false);
NotesPanel.setVisible(false);
EditNotesPanel.setVisible(false);
CalcPanel.setVisible(false);
ImagesPanel2.setVisible(false);
}
//user define method
Private void action(String button)
{
int type= 0;
if(Type.getText().equals(“123…”))
type=1;
else if(Type.getText().equals(“abc…”))
type=2;
else if(Type.getText().equals(“ABC…”))
type=3;
if (MainPanel.isVisible())
{
MainPanel.setVisible(false);
DailPanel.setVisible(true);
DialNumber.setText(button.charAt(2)+””);
}
else if(SavePanel.isVisible())
{
String s1= NameTF.getText();
if (s1.equals(“”))
NameTF.setText(button.charAt(0));
else if(type==1|| type==3)
NameTF.setText(s1+button.charAt(0));
Else
{ char ch= Charater.toLowerCase(button.charAt(0));
NameTF.setText(s1+ch);
}
}
else if(DailPanel.isVisible())
{
DialNumber.setText(DialNumber.getText()+button.ch
arAt(2));
}
else if(ContactPanel.isVisible())
{ NumberTF2.setText(“”);
index=1;
search(index,button.charAt(0));
}
else if(EditNoteSPanel.isVisible())
{
addNote(button,type);
}
else if(calcPanel.isVisible())
{
if(index4 == 1)
{
if(Character.isDigit(button.charAt(2)))
{
String str= Operand1TF.getText();
Operand1TF.setText(str+button.charAt(2));
}
}
else if(index4 == 3)
if(Character.isDigit(button.charAt(2)))
{
String str= Operand2TF.getText();
Operand2TF.setText(str+button.charAt(2));
}
}
else if(index4 == 2)
{
char ch=button.charAt(2);
if(ch ==‘+’||ch==‘-’||ch==‘*’||ch==‘/’)
{
OperatorTF.setText(ch+””); } } }
}
//user-defined mehod
private void viewLog()
{
try{
String name;
DateFormate
df=DateFormate.getDateInstance(DateFormate.SHOR
T);
Class.forName(“java.sql.Driver”);
String database=“jdbc:mysql://localhost:3306/Mobile”;
connection conn=
DriverManager.getConnection(database,”root”,”wxyz
”);
Statement stmt=conn.createStatement();
String sql2=“SELECT * FROM CallRegister oder by
Time desc”;
ResultSet rs= stmt.executeQuery(sql2);
int i=0;
CallLogTA.setText(“”);
while(rs.next())
{ name = rs.getString(“name”);
if(name.equals(“null”))
CallLogTA.append(rs.getString(“number”));
else
CallLogTA.append(name);
CallLogTA.append(“nt”+df.formate(rs.getDate(“Time”
))+”nn”);
i++;
if(i>=8)
break;
}
CallLogTA.setCarePosition(0);
rs.close();
Stmt.close();
conn.close();
}
catch(Exception e){CallLogTA.setText(“No entery
found”);
JOptionPane.showMessageDialog(null,””+e);}
}
//user-defined method
private void viewNotes()
{
try{
Class.forName(“java.sql.Driver”);
Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”;
Connection
conn=DriverManager.getConnection(database,”root”,
”wxyz”);
Statement stmt= conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
String sql=“SELECT * FROM Notes order by date”;
ResultSet rs = stmt.executeQuery(sql);
for(int i =0;i<index2;i++)
{
if(rs.isLast())
{
rs.first();
}
Else
rs.next();
}
DateFormate df=
DateFormate.getDataInstance(DateFormate.SHORT)
DateFormate df=
DateFormate.getDataInstance(DateFormate.SHORT);
DateTF.setText(df.format(rs.getDate(1)));
NoteTA.setText(rs.getString(2));
rs.close();
Stmt.close();
conn.close();
}
catch(Exception e){ NoteTA.setText(“empty”);
JOptionPane.showMessageDialog(null,””+e);
}
}
//user-defined method
private void addNote(String button,int type) {
if(index==1)
{ DateTF2.append(button.char(2)+””);
}
Else{ String s1=NoteTA2.getText();
if (type==1)
NoteTA.setText(s1+button.charAt(2));
else if(type == 3)
NoteTA.setText(s1+button.charAt(0));
else {
char ch= Character.tolowercase(button. char(0));
NoteTA2.setText(s1+ch);
}
}
}
//user-defined method
private void calcResult()
{ long num1=
Long.parseLong(Operand1TF.getText());
char op= OperatorTF.getText()charAt(0);
long num2= Long.parseLong(Operand2TF.getText());
long Result=0;
switch(op)
{ case’+’: Result= num1+num2; break;
case’-’: Result= num1-num2; break;
case’*’: Result= num1*num2; break;
case’/’: Result= num1/num2; break;
default: ResultTF.setText(“Invalid Options”);
}
ResultTF.setText(Result+””);
}
private void B
ActionPerformed(java.awt.event.ActionEvent evt){
action(“B+”);
}
private void C
ActionPerformed(java.awt.event.ActionEvent evt){
action(“C 1”);
}
private void E
ActionPerformed(java.awt.event.ActionEvent evt){
action(“E 3”);
}
private void H
ActionPerformed(java.awt.event.ActionEvent evt){
action(“H -”);
}
private void F
ActionPerformed(java.awt.event.ActionEvent evt){
action(“F(”);
}
private void D
ActionPerformed(java.awt.event.ActionEvent evt){
action(“D 2”); }
private void k
ActionPerformed(java.awt.event.ActionEvent evt){
action(“K 5”); }
private void J
ActionPerformed(java.awt.event.ActionEvent evt){
action(“J 4”); }
private void I
ActionPerformed(java.awt.event.ActionEvent evt){
action(“I -”); }
private void CalcB
ActionPerformed(java.awt.event.ActionEvent evt){
MainPanel.setVisible(false);
CalcPanel.setVisible(true);
index4=1;
OperandTF.setText(“”);
OperaterTF.setText(“”);
Operand2TF.setText(“”);
ResultTF.setText(“”);
}
private void L
ActionPerformed(java.awt.event.ActionEvent evt){
action(“L 6”); }
private void M
ActionPerformed(java.awt.event.ActionEvent evt){
action(“M :”); }
private void N
ActionPerformed(java.awt.event.ActionEvent evt){
action(“N ;”); }
private void S
ActionPerformed(java.awt.event.ActionEvent evt){
action(“S 9”); }
private void R
ActionPerformed(java.awt.event.ActionEvent evt){
action(“R 8”); }
private void P
ActionPerformed(java.awt.event.ActionEvent evt){
action(“P *”); }
private void $
ActionPerformed(java.awt.event.ActionEvent evt){
action(“# &”); }
private void V
ActionPerformed(java.awt.event.ActionEvent evt){
action(“V =”); }
private void O
ActionPerformed(java.awt.event.ActionEvent evt){
action(“O @”); }
private void Q
ActionPerformed(java.awt.event.ActionEvent evt)
{action(“Q 7”); }
private void X
ActionPerformed(java.awt.event.ActionEvent evt){
action(“X 0”); }
private void G
ActionPerformed(java.awt.event.ActionEvent evt){
action(“G )”); }
private void T
ActionPerformed(java.awt.event.ActionEvent evt){
action(“T ’”); }
private void W
ActionPerformed(java.awt.event.ActionEvent evt){
action(“W $”); }
private void Shift
ActionPerformed(java.awt.event.ActionEvent evt){
if (Type.getText().equals(“123…….”))
{ Type.setText(“abc.......”);}
else if (Type.getText().equals(“abc…….”))
{ Type.setText(“ABC.......”);}
else
{ Type.setText(“123.......”);}
}
private void Y
ActionPerformed(java.awt.event.ActionEvent evt){
action(“Y %”); }
private void Z
ActionPerformed(java.awt.event.ActionEvent evt){
action(“Z ?”); }
private void _
ActionPerformed(java.awt.event.ActionEvent evt){
action(“, .”); }
private void A
ActionPerformed(java.awt.event.ActionEvent evt){
action(“A /”); }
private void U
ActionPerformed(java.awt.event.ActionEvent evt){
action(“U ”); }
// user-defined method
private void dail(long num)
{
string name= null;
java.until.Date d= new.java.until.Date();
DateFormate
df=DateFormate.getDateInstance(DateFormate.SHOR
T);
try{
Class.forName(“java.sql.Drive”);
String
database=“jdbc:mysql;//localhost:3306/Mobile”;
Connection
conn=DriverManager.getConnection(database, “root,
“wxyz”);
Statement stmt= conn.createStatement();
String sql2=“SELECT name FROM Contacts WHERE
number= “+ num;
ResultSet rs= stmt.executeQuery(sql2);
try{
if(rs.next())
{ name= rs.setString(1);
}
}
catch (Exception e) {
JOptionPane.showMessageDialog(null,””+e);}
String sql= “INSERT INTO CallRegister VALUES(’ ”+ ‘
“,”+num+”, ’ ”+df.formate(d)+ “’)”;
stmt.executeUpdate(sql);
Dialnumber2.setText(“calling….n”+num);
stmt.close();
conn.close();
}
catch(Exeception e)
{ DialNumber2.setText(“Invalid Number”);
JOptionPane.showMessageDialog(null,””+e);
} }
private void Dail
ActionPerformed(java.awt.event.ActionEvent evt){
if(DialPanel.isVisible())
{ Dailpanel.setVisible(false);
long num= 0;
DialPanel2.setVisible(true);
Try
{ num= Long.parseLong(DialNumber.getText());
dial (num);
}
catch(Exception e)
{ DialNumber2.setText(“Invalid Number”);
JOptionPane.showMessageDialog(null, “”+e);
}
}
else if (ContactPanel.isVisible())
{
ContactPanel.setVisible(false);
DialPanel2.setVisible(true);
try
{ long num= 0;
num= Long.parseLong(NumberTF2.getText());
dail(num); }
catch(Exception e)
{
{ DialNumber2.setText(“Invalid Number”);
JOptionPane.showMessageDialog(null, “”+e);
}
} }
private void Cancel
ActionPerformed(java.awt.event.ActionEvent evt)
{
MainPanel.setVisible(true);
DailPanel.setVisible(false);
DailPanel2.setVisible(false);
SavePanel.setVisible(false);
ContactPanel.setVisible(false);
LogPanel.setVisible(false);
NotesPanel.setVisible(false);
EditNotesPanel.setVisible(false);
CalcPanel.setVisible(false);
ImagesPanel.setVisible(false);
ImagesPanel2.setVisible(false);
}
private void Right
ActionPerformed(java.awt.event.ActionEvent evt){
if(MainPanel.isVisible())
{ MainPanel.setVisible(false);
viewLog();
LogPanel.setVisible(true);}
else if(DailPanel.isVisible())
{ String str= DailNumber.getText();
str= str.substring(0,str.length()-1);
DialNumber.setText(str);
}
else if(SavePanel.isVisible())
{
String str= NameTF.getText();
str= str.subString(0, str.length()-1);
NameTF.setText(str);
}
else if(ContactPanel.isVisible())
{ index++;
search(index,’*’);
}
else if(LogPanel.isVisible())
{ LogPanel.setVisble(false);
index2 = 1;
viewNotes();
NotesPanel.setVisible(true);
}
else if(NotesPanel.isVisible())
{ index++;
viewNotes();
}
else if(EditNotesPanel.isVisble())
{ String str= NoteTA2.getText();
NoteTA2.setText(str.substring(0,str.length()-1));
}
else if(Calcpanel.isVisible())
{ String str;
if(index4 == 1)
{ str= OperandTF.getText();
OperandTF.setText(str.substring(0,str.length()-1));
}
if(index4 == 2)
{ str= Operand2TF.getText();
Operand2TF.setText(str.substring(0,str.length()-1));
}
}
else if(ImagesPanel.isVisible())
{
if(icon1.isEnabled())
{ icon1.setEnabled(true);
icon2.setEnabled(false);
icon1L.setEnabled(true);
icon2L.setEnabled(false);
}
if(icon2.isEnabled())
{ icon2.setEnabled(true);
icon3.setEnabled(false);
icon2L.setEnabled(true);
icon3L.setEnabled(false);
}
if(icon3.isEnabled())
{ icon3.setEnabled(true);
icon4.setEnabled(false);
icon3L.setEnabled(true);
icon4L.setEnabled(false);
}
if(icon4.isEnabled())
{ icon4.setEnabled(true);
icon1.setEnabled(false);
icon4L.setEnabled(true);
icon1L.setEnabled(false);
} } }
private void OK
ActionPerformed(java.awt.event.ActionEvent evt){
if(DailPanel.isVisible())
{ String n = DailNumber.getNumber();
NumberTF.setText(n);
DailPanel.setVisible(false);
SavePanel.setVisible(true);
NameTF.setText(””);
}
else if(SavePanel.isVisible())
{ String name=NameTf.getText();
String num= NumberTF.getText():
try
{
Class.forName(“java.sql.Driver”);
Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”;
Connection
conn=DriverManager.getConnection(database,”root”,
”wxyz”);
Statement stmt= conn.createStatement();
String sql=“INSERT INTO Contacts
VALUES(’”+name+”’,”+num+”)”;
stmt.executeUpdate(sql);
SavePanel.setVisible(false);
MainPanel.setVisible(true);
stmt.close();
conn.close(); }
catch(Exception e){
JOptionPane.showMessageDialog(null,””+e); }
}
else if(MainPanel.isVisible())
{ MainPanel.setVisible(false);
ContactPanel.setVisible(true);
index=1;
search(index,’*’);
}
else if(ContactPanel.isVisible())
{ ContactPanel.setVisible(false);
DailPanel2.setVisible(true);
try
{ long num=0;
num= Long.parseLong(NumberTF2.getText());
dial(num);
}
catch(Exception e)
{ DailNumber2.setText(“Invalid Number”)
JOptionPane.showMessageDialog(n ull,””+e);
}
}
else if(NotesPanel.isVisible())
{NotesPanel.setVisible(false);
EditNotesPanel.setVisible(true);
}
else if(EditNotesPanel.isVisible())
{
try
{Class.forName(“java.sql.Driver”);
Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”;
Connection
conn=DriverManager.getConnection(database,”root”,
”wxyz”);
Statement stmt= conn.createStatement();
String sql=“INSERT INTO Notes
VALUES(’”+DateTF.getText()+”’,”+NotesTF.getText()+”)”
;
stmt.executeUpdate(sql);
EditNotesPanel.setVisible(false);
MainPanel.setVisible(true);
stmt.close();
conn.close(); }
catch(Exception e){
JOptionPane.showMessageDialog(null,””+e); }
}
else if(Calcpanel.isVisible())
{ calcResult();
index4= 1;
}
else if(ImagesPanel.isVisible())
{ ImagesPanel.setVisible(false);
ImagesPanel2.setVisible(true);
if(!icon1.isEnabled())
ImgL.setIcon(new ImagesIcon(“scrImage1.jpg));
else if(!icon2.isEnabled())
ImgL.setIcon(new ImagesIcon(“scrImage2.jpg));
else if(!icon3.isEnabled())
ImgL.setIcon(new ImagesIcon(“scrImage3.jpg));
else if(!icon4.isEnabled())
ImgL.setIcon(new ImagesIcon(“scrImage4.jpg));
}
}
//user-defined method
private void Search
ActionPerformed(java.awt.event.ActionEvent evt){
try {
Class.forName(“java.sql.Driver”);
Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”;
Connection
conn=DriverManager.getConnection(database,”root”,
”wxyz”);
Statement stmt= conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
String sql=“SELECT * FROM Contacts”;
if(option!=‘*’)
Sql+=“WHERE name like’”+option+”%’”
sql+=“order by name”;
ResultSet rs = stmt.executeQuery(sql);
for(int i =0;i<n;i++)
{
if(rs.isLast())
{
rs.first();
}
else
rs.next(); }
NameTF2.setText(rs.getString(“name”));
NumberTF2.setText(rs.getString(“number”));
}
catch(Exception e)
{NameTF2.setText(“Not found”);
JOptionPane.showMessageDialog(null,””+e); }
}
private void Left
ActionPerformed(java.awt.event.ActionEvent evt){
try {
Class.forName(“java.sql.Driver”);
Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”;
Connection
conn=DriverManager.getConnection(database,”root”,
”wxyz”);
Statement stmt= conn.createStatement();
if(MainPanel.isVisible())
{MainPanel.setVisible(false);
ImagesPanel.setVisible(true); }
else if(DialPanel.isVisible())
{DailPanel.setVisible(false);
long num= 0;
DailPanel.setVisible(true);
try
{num= Long.parseLong(DialNumber.getText());
dail(num); }
catch(Exception e)
{
{ DialNumber2.setText(“Invalid Number”);
JOptionPane.showMessageDialog(null, “”+e);
} }
else if(ContactPanel.isVisible())
{ String name=NameTF2.getText();
int num=Integer.parseInt(NumberTF2.getText());
String sql=“DELETE FROM Contacts WHERE
name=+”’AND number=”+num;
stmt.executeUpdate(sql);
MainPanel.setVisible(true);
ContactPanel.setVisible(false); }
else if(SavePanel.isVisible())
{ MainPanel.setVisible(true);
SavePanel.setVisible(false); }
else if(LogPanel.isVisible())
{ String sql=“delete FROM CallRegister”;
stmt.executeUpdate(sql);
{ LogPanel.setVisible(false);
MainPanel.setVisible(true);
}
else if(NotesPanel.isVisible())
{ String text= NoteTA.getText();
String sql=“DELETE FROM Notes WHERE
Text=”’+text+”’”;
stmt.executeUpdate(sql);
index2=1;
viweNotes(); }
else if(EditNotesPanel.isVisible())
{ index3=1;
}
else if(Calcpanel.isVisible())
{ index4= 1;
Operand1TF.setText(“”);
OperaterTF.setText(“”);
Operand2TF.setText(“”);
ResultTF.setText(“”);
}
else if(ImagesPanel.isVisible())
{ ImagesPanel.setVisible(false);
MainPanel.setVisible(true); }
else if(ImagesPane2.isVisible())
{ImagesPane2.setVisible(false);
ImagesPanel1.setVisible(true); }
stmt.close();
conn.close(); }
catch(Exception e){
JOptionPane.showMessageDialog(null,””+e);
}
private void Space
ActionPerformed(java.awt.event.ActionEvent evt){
action(“ “);
}
private void LogB
ActionPerformed(java.awt.event.ActionEvent evt)
{MainPanel.setVisible(false);
viewLog();
LogPanel.setVisible(true);
}
private void NotesB
ActionPerformed(java.awt.event.ActionEvent evt)
{MainPanel.setVisible(false);
NotesPanel.setVisible(true);
index2= 1;
viewNotes();
}
private void Enter
ActionPerformed(java.awt.event.ActionEvent evt)
{ try { if(EditNotesPanel.isVisible()&& index3==1)
{ index3=2;
Type.setText(“ABC…”) }
else if(Calcpanel.isVisible())
{ if (index4==1)
index4= 2;
else if (index4==2)
index4= 3;
else if (index4==3)
{ calcResult();
index4= 1;
}
}
else
action(“nn”);
}
catch(Exception e){
JOptionPane.showMessageDialog(null,””+e);
}
private void icon1
ActionPerformed(java.awt.event.ActionEvent evt)
{ImagesPanel.setVisible(false);
ImagesPanel2.setVisible(true);
ImgL.setIcon(new ImagesIcon(“scrImage1.jpg));
private void icon3
ActionPerformed(java.awt.event.ActionEvent evt)
{ImagesPanel.setVisible(false);
ImagesPanel2.setVisible(true);
ImgL.setIcon(new ImagesIcon(“scrImage3.jpg));
}
private void icon2
ActionPerformed(java.awt.event.ActionEvent evt)
{ImagesPanel.setVisible(false);
ImagesPanel2.setVisible(true);
ImgL.setIcon(new ImagesIcon(“scrImage2.jpg));
}
private void FilesB
ActionPerformed(java.awt.event.ActionEvent evt)
{MainPanel.setVisible(false);
icon1.setSelected(true);
ImagesPanel.setVisible(true);
}
private void icon 4
ActionPerformed(java.awt.event.ActionEvent evt)
{ImagesPanel.setVisible(false);
ImagesPanel2.setVisible(true);
ImgL.setIcon(new ImagesIcon(“scrImage4.jpg));
}
public static void main(String args[]) {
java.awt.EventQueue.incokeLater(new Runnable()) {
public void run() {
new Mobile.setVisible(true);
}
});
}
Database structure
The database used in this application is Mobile
database of MySQL. It consists of following Tables;
Tables_in_mobile
callregister
contacts
notes
1. Callregister Table
This table stores all the details of the calls made and
the time of call. Its structure is:
Field Type Null Key Default Extra
Name varchar
(20)
YES NULL
Number varchar
(20)
YES NULL
Time date YES NULL
2. Contacts Table
This table stores all the details of the contacts stored.
Its structure is:
Field Type Null Key Default Extra
Name varchar
(20)
YES NULL
Number bigint
(20)
NO PRI NULL
3.Notes Table
This table stores all the details of the notes stored.
Its structure is:
Field Type Null Key Defaul
t
Extra
date date YES NULL
text varchar
(200)
YES NULL
B ibliography
T ext B ook Of I nformatics
P ractices
I nternet
o http://www.cbseipprojects.in
Desktop
S mart P hone
S oftware's
 Mysql
 NetBeans IDE 6.0
M y I .P T eacher
 Miss Gauri Mam

More Related Content

PDF
IP project for class 12 cbse
DOC
Ip project
DOCX
JAVA AND MYSQL QUERIES
DOCX
Ip project work test your knowledge
DOCX
Informatics Practice Practical for 12th class
PDF
Informatics Practices/ Information Practices Project (IP Project Class 12)
PDF
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
PDF
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
IP project for class 12 cbse
Ip project
JAVA AND MYSQL QUERIES
Ip project work test your knowledge
Informatics Practice Practical for 12th class
Informatics Practices/ Information Practices Project (IP Project Class 12)
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)

What's hot (20)

PDF
Rajeev oops 2nd march
PDF
Java File
PDF
MaintainStaffTable
PPTX
Tools and Techniques for Understanding Threading Behavior in Android*
PPTX
Writing Good Tests
PPTX
clean code book summary - uncle bob - English version
PPTX
C programming
DOCX
Computer science project work
TXT
c++ project on restaurant billing
PPTX
Clean code
PPTX
Clean code
DOCX
Informatics Practices Project on Tour and travels
PPTX
Clean code
PDF
Java Practical File Diploma
TXT
c++ program for Railway reservation
KEY
Indexing thousands of writes per second with redis
PDF
PVS-Studio in 2021 - Error Examples
PPTX
Clean Code: Chapter 3 Function
Rajeev oops 2nd march
Java File
MaintainStaffTable
Tools and Techniques for Understanding Threading Behavior in Android*
Writing Good Tests
clean code book summary - uncle bob - English version
C programming
Computer science project work
c++ project on restaurant billing
Clean code
Clean code
Informatics Practices Project on Tour and travels
Clean code
Java Practical File Diploma
c++ program for Railway reservation
Indexing thousands of writes per second with redis
PVS-Studio in 2021 - Error Examples
Clean Code: Chapter 3 Function
Ad

Viewers also liked (6)

PDF
Best Way to Write SQL in Java
PPTX
Modul Kelas Programming : Java MySQL
DOCX
informatics practices practical file
PPTX
PPT FOR ONLINE HOTEL MANAGEMENT
PPT
Investigatory Project
PPT
Tic tac toe c++ project presentation
Best Way to Write SQL in Java
Modul Kelas Programming : Java MySQL
informatics practices practical file
PPT FOR ONLINE HOTEL MANAGEMENT
Investigatory Project
Tic tac toe c++ project presentation
Ad

Similar to Ip project visual mobile (20)

DOCX
Final report mobile shop
PPTX
AWT stands for Abstract Window Toolkit. AWT is collection of classes and int...
PDF
Java Programming Projects
PPTX
Ramraj
PPTX
mod3part 3 of robotic process automation
DOCX
Assignment6~$signment6.docxAssignment6Assignment6.docxAs.docx
DOCX
Advance Java Programs skeleton
PDF
MIDP GUI Development: Alert, List, Form, TextBox
PDF
1. Section1.- Populating the list of persons on the person listing f.pdf
PDF
1. Section1.- Populating the list of persons on the person listing.pdf
DOCX
Library management system
PPTX
PDF
3. Section 3 � Complete functionality on listing screen (1.5 marks.pdf
PPTX
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
DOCX
Java project
DOC
Advanced Java - Praticals
PDF
LeakChecker: Practical Static Memory Leak Detection for Managed Languages
DOCX
1 Project 2 Introduction - the SeaPort Project seri.docx
DOC
Ad java prac sol set
PPT
Mobile management
Final report mobile shop
AWT stands for Abstract Window Toolkit. AWT is collection of classes and int...
Java Programming Projects
Ramraj
mod3part 3 of robotic process automation
Assignment6~$signment6.docxAssignment6Assignment6.docxAs.docx
Advance Java Programs skeleton
MIDP GUI Development: Alert, List, Form, TextBox
1. Section1.- Populating the list of persons on the person listing f.pdf
1. Section1.- Populating the list of persons on the person listing.pdf
Library management system
3. Section 3 � Complete functionality on listing screen (1.5 marks.pdf
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
Java project
Advanced Java - Praticals
LeakChecker: Practical Static Memory Leak Detection for Managed Languages
1 Project 2 Introduction - the SeaPort Project seri.docx
Ad java prac sol set
Mobile management

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Pre independence Education in Inndia.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Institutional Correction lecture only . . .
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
master seminar digital applications in india
PDF
01-Introduction-to-Information-Management.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Insiders guide to clinical Medicine.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Computing-Curriculum for Schools in Ghana
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPH.pptx obstetrics and gynecology in nursing
Pre independence Education in Inndia.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Institutional Correction lecture only . . .
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
master seminar digital applications in india
01-Introduction-to-Information-Management.pdf
Anesthesia in Laparoscopic Surgery in India
Insiders guide to clinical Medicine.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Microbial disease of the cardiovascular and lymphatic systems
Computing-Curriculum for Schools in Ghana
Abdominal Access Techniques with Prof. Dr. R K Mishra
Module 4: Burden of Disease Tutorial Slides S2 2025
Final Presentation General Medicine 03-08-2024.pptx
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers

Ip project visual mobile

  • 1. KENDRIYA VIDYALAYA NO.1 CANTT SHAHJAHANPUR INFORMATICSPRACTICES PROJECTWORK 2014-15 Submit t ed t o:- MISS.GAURI GUSAIN Submit t ed by miss:- kuma r i bha vna CLASS:- XII “COMMERCE” ROLLNO:- Pgt I.P
  • 2. INDEX S .no T opic 1 Acknowledgement 2 Certificate 3 Cover P age 4 Visual M obile oTechnology Used 5 P roject Design 6 I nterface(M obile.java) 7 M obile.java(start S creen) Main Menu Dial Panel Dial Panel2 Save Panel ContactsPanel LogPanel Notes Panel EditnotesPanel Calculator(calcPanel)
  • 3. Ima ge Pa nel Ful l view Of Sel ect ed Ima ge(ima gepa nel 2) 8 Code 9 DatabaseS tructure Callregister Contacts Table Notes Table
  • 4. CERTIFICATE SUCCESSFULLYCOMPLETEHIS/ HERPROJECT UNDERMYGUIDANCE.SHEHASTAKENPROPER CAREANDSHOWNATMOSTSINCERITYIN COMPLETIONOFTHIS PROJECT. I CERTIFYTHATTHIS PROJECTIS UPTOMY EXPECTATIONANDAS PERTHELATEST GUIDELINESISSUEDBYCBSEDEHRADUN. THIS ISTOCERTIFYTHATMR./ MISS KUMARI BHAVNASTUDENT OFCLASS XII OF ...KENDRIYA..VIDYALAYA..NO.1..CANTT..S.P.N SCHOOL DATE TEACHERSIGNATURE
  • 5. Acknowledgem entI gratefully acknowledge the valuable guidance and support given to me by my informatics practices teacher Mr./Mrs.….Gauri Gusain……in successfully completing my project report. This project gave me a clear insight into real world business situations and gave me ample opportunities to apply my theoretical knowledge to practical situations. I would also like to thank my classmates for their suggestion and support in completing this project
  • 7. INTRODUCTION This project simulates the functionally of a mobile set visually though java swing programming. This projects USES DATA BASE CONNECTIVITY to store call details contact details. etc. in a MySQL database. TECHNOLOGY USED Front end: Java Swing Back end: MySQL
  • 8. Project Design This project consist of a single interface(Mobile.java) that simulates the functionally of a mobile set using many pictures and a database as evident from its Project window shown below;
  • 9. INTERFACE (Mobile. Java) The Mobile. Java Interface Has Been Divided Into Two Parts; Upper Panel Keypad Panel i.e., Where Lower Panel Is Keypad Panel Which Is Visible All The Time. The Upper Panel Changes As Per The Function Chosen E.g., It Displays Dial Panel, save Panel, contact Panel, notes Panel, calculator Panel Etc.
  • 10. The upper panel itself is divided into tow parts. Top Panel <Function>Panel A sample upper panel is shown below: There are various function panels e.g., Dial panel, Save panel, Calculator panel, notes panel etc. in the projects that have been stored inside TopPanel and these lie over one another with the help of cardLayout.
  • 11. 1.MOBILE.JAVA (START SCREEN) Before Listing The Code, it Is Important To Understand The Functioning Of The Interface, which Is Being Explained Below With The Help Of Screen Shots.
  • 12. CODE : import java.sql.*; import javax.swing.JOptionPane; import java.text.*; import javax.swing.ImageIcon; public class Mobile extends javax.swing.JFrame { //Global Variables int index = 1; //for iterating through contacts int index2 = 1; //for iterationg through notes int index3 = 1; //for adding new notes int index4 = 1; //for calculator /**Constructor*/ public Mobile() { initcomponents(); MainPanel.setVisible(true); DailPanel.setVisible(false); DailPanel.setVisible(false); SavePanel.setVisible(false); ContactPanel.setVisible(false); LogPanel.setVisible(false); NotesPanel.setVisible(false); EditNotesPanel.setVisible(false); CalcPanel.setVisible(false);
  • 13. ImagesPanel2.setVisible(false); } //user define method Private void action(String button) { int type= 0; if(Type.getText().equals(“123…”)) type=1; else if(Type.getText().equals(“abc…”)) type=2; else if(Type.getText().equals(“ABC…”)) type=3; if (MainPanel.isVisible()) { MainPanel.setVisible(false); DailPanel.setVisible(true); DialNumber.setText(button.charAt(2)+””); } else if(SavePanel.isVisible()) { String s1= NameTF.getText(); if (s1.equals(“”)) NameTF.setText(button.charAt(0));
  • 14. else if(type==1|| type==3) NameTF.setText(s1+button.charAt(0)); Else { char ch= Charater.toLowerCase(button.charAt(0)); NameTF.setText(s1+ch); } } else if(DailPanel.isVisible()) { DialNumber.setText(DialNumber.getText()+button.ch arAt(2)); } else if(ContactPanel.isVisible()) { NumberTF2.setText(“”); index=1; search(index,button.charAt(0)); } else if(EditNoteSPanel.isVisible()) { addNote(button,type); }
  • 15. else if(calcPanel.isVisible()) { if(index4 == 1) { if(Character.isDigit(button.charAt(2))) { String str= Operand1TF.getText(); Operand1TF.setText(str+button.charAt(2)); } } else if(index4 == 3) if(Character.isDigit(button.charAt(2))) { String str= Operand2TF.getText(); Operand2TF.setText(str+button.charAt(2)); } } else if(index4 == 2) { char ch=button.charAt(2); if(ch ==‘+’||ch==‘-’||ch==‘*’||ch==‘/’) { OperatorTF.setText(ch+””); } } } }
  • 16. //user-defined mehod private void viewLog() { try{ String name; DateFormate df=DateFormate.getDateInstance(DateFormate.SHOR T); Class.forName(“java.sql.Driver”); String database=“jdbc:mysql://localhost:3306/Mobile”; connection conn= DriverManager.getConnection(database,”root”,”wxyz ”); Statement stmt=conn.createStatement(); String sql2=“SELECT * FROM CallRegister oder by Time desc”; ResultSet rs= stmt.executeQuery(sql2); int i=0; CallLogTA.setText(“”); while(rs.next()) { name = rs.getString(“name”); if(name.equals(“null”)) CallLogTA.append(rs.getString(“number”));
  • 18. private void viewNotes() { try{ Class.forName(“java.sql.Driver”); Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”; Connection conn=DriverManager.getConnection(database,”root”, ”wxyz”); Statement stmt= conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); String sql=“SELECT * FROM Notes order by date”; ResultSet rs = stmt.executeQuery(sql); for(int i =0;i<index2;i++) { if(rs.isLast()) { rs.first(); } Else rs.next(); } DateFormate df= DateFormate.getDataInstance(DateFormate.SHORT)
  • 19. DateFormate df= DateFormate.getDataInstance(DateFormate.SHORT); DateTF.setText(df.format(rs.getDate(1))); NoteTA.setText(rs.getString(2)); rs.close(); Stmt.close(); conn.close(); } catch(Exception e){ NoteTA.setText(“empty”); JOptionPane.showMessageDialog(null,””+e); } } //user-defined method private void addNote(String button,int type) { if(index==1) { DateTF2.append(button.char(2)+””); } Else{ String s1=NoteTA2.getText(); if (type==1) NoteTA.setText(s1+button.charAt(2)); else if(type == 3) NoteTA.setText(s1+button.charAt(0)); else { char ch= Character.tolowercase(button. char(0));
  • 20. NoteTA2.setText(s1+ch); } } } //user-defined method private void calcResult() { long num1= Long.parseLong(Operand1TF.getText()); char op= OperatorTF.getText()charAt(0); long num2= Long.parseLong(Operand2TF.getText()); long Result=0; switch(op) { case’+’: Result= num1+num2; break; case’-’: Result= num1-num2; break; case’*’: Result= num1*num2; break; case’/’: Result= num1/num2; break; default: ResultTF.setText(“Invalid Options”); } ResultTF.setText(Result+””); } private void B ActionPerformed(java.awt.event.ActionEvent evt){ action(“B+”); }
  • 21. private void C ActionPerformed(java.awt.event.ActionEvent evt){ action(“C 1”); } private void E ActionPerformed(java.awt.event.ActionEvent evt){ action(“E 3”); } private void H ActionPerformed(java.awt.event.ActionEvent evt){ action(“H -”); } private void F ActionPerformed(java.awt.event.ActionEvent evt){ action(“F(”); } private void D ActionPerformed(java.awt.event.ActionEvent evt){ action(“D 2”); } private void k ActionPerformed(java.awt.event.ActionEvent evt){ action(“K 5”); } private void J ActionPerformed(java.awt.event.ActionEvent evt){ action(“J 4”); }
  • 22. private void I ActionPerformed(java.awt.event.ActionEvent evt){ action(“I -”); } private void CalcB ActionPerformed(java.awt.event.ActionEvent evt){ MainPanel.setVisible(false); CalcPanel.setVisible(true); index4=1; OperandTF.setText(“”); OperaterTF.setText(“”); Operand2TF.setText(“”); ResultTF.setText(“”); } private void L ActionPerformed(java.awt.event.ActionEvent evt){ action(“L 6”); } private void M ActionPerformed(java.awt.event.ActionEvent evt){ action(“M :”); } private void N ActionPerformed(java.awt.event.ActionEvent evt){ action(“N ;”); } private void S ActionPerformed(java.awt.event.ActionEvent evt){ action(“S 9”); }
  • 23. private void R ActionPerformed(java.awt.event.ActionEvent evt){ action(“R 8”); } private void P ActionPerformed(java.awt.event.ActionEvent evt){ action(“P *”); } private void $ ActionPerformed(java.awt.event.ActionEvent evt){ action(“# &”); } private void V ActionPerformed(java.awt.event.ActionEvent evt){ action(“V =”); } private void O ActionPerformed(java.awt.event.ActionEvent evt){ action(“O @”); } private void Q ActionPerformed(java.awt.event.ActionEvent evt) {action(“Q 7”); } private void X ActionPerformed(java.awt.event.ActionEvent evt){ action(“X 0”); } private void G ActionPerformed(java.awt.event.ActionEvent evt){ action(“G )”); }
  • 24. private void T ActionPerformed(java.awt.event.ActionEvent evt){ action(“T ’”); } private void W ActionPerformed(java.awt.event.ActionEvent evt){ action(“W $”); } private void Shift ActionPerformed(java.awt.event.ActionEvent evt){ if (Type.getText().equals(“123…….”)) { Type.setText(“abc.......”);} else if (Type.getText().equals(“abc…….”)) { Type.setText(“ABC.......”);} else { Type.setText(“123.......”);} } private void Y ActionPerformed(java.awt.event.ActionEvent evt){ action(“Y %”); } private void Z ActionPerformed(java.awt.event.ActionEvent evt){ action(“Z ?”); } private void _ ActionPerformed(java.awt.event.ActionEvent evt){ action(“, .”); }
  • 25. private void A ActionPerformed(java.awt.event.ActionEvent evt){ action(“A /”); } private void U ActionPerformed(java.awt.event.ActionEvent evt){ action(“U ”); } // user-defined method private void dail(long num) { string name= null; java.until.Date d= new.java.until.Date(); DateFormate df=DateFormate.getDateInstance(DateFormate.SHOR T); try{ Class.forName(“java.sql.Drive”); String database=“jdbc:mysql;//localhost:3306/Mobile”; Connection conn=DriverManager.getConnection(database, “root, “wxyz”); Statement stmt= conn.createStatement(); String sql2=“SELECT name FROM Contacts WHERE number= “+ num;
  • 26. ResultSet rs= stmt.executeQuery(sql2); try{ if(rs.next()) { name= rs.setString(1); } } catch (Exception e) { JOptionPane.showMessageDialog(null,””+e);} String sql= “INSERT INTO CallRegister VALUES(’ ”+ ‘ “,”+num+”, ’ ”+df.formate(d)+ “’)”; stmt.executeUpdate(sql); Dialnumber2.setText(“calling….n”+num); stmt.close(); conn.close(); } catch(Exeception e) { DialNumber2.setText(“Invalid Number”); JOptionPane.showMessageDialog(null,””+e); } } private void Dail ActionPerformed(java.awt.event.ActionEvent evt){ if(DialPanel.isVisible()) { Dailpanel.setVisible(false); long num= 0;
  • 27. DialPanel2.setVisible(true); Try { num= Long.parseLong(DialNumber.getText()); dial (num); } catch(Exception e) { DialNumber2.setText(“Invalid Number”); JOptionPane.showMessageDialog(null, “”+e); } } else if (ContactPanel.isVisible()) { ContactPanel.setVisible(false); DialPanel2.setVisible(true); try { long num= 0; num= Long.parseLong(NumberTF2.getText()); dail(num); } catch(Exception e) { { DialNumber2.setText(“Invalid Number”); JOptionPane.showMessageDialog(null, “”+e); } } }
  • 28. private void Cancel ActionPerformed(java.awt.event.ActionEvent evt) { MainPanel.setVisible(true); DailPanel.setVisible(false); DailPanel2.setVisible(false); SavePanel.setVisible(false); ContactPanel.setVisible(false); LogPanel.setVisible(false); NotesPanel.setVisible(false); EditNotesPanel.setVisible(false); CalcPanel.setVisible(false); ImagesPanel.setVisible(false); ImagesPanel2.setVisible(false); } private void Right ActionPerformed(java.awt.event.ActionEvent evt){ if(MainPanel.isVisible()) { MainPanel.setVisible(false); viewLog(); LogPanel.setVisible(true);} else if(DailPanel.isVisible()) { String str= DailNumber.getText(); str= str.substring(0,str.length()-1);
  • 29. DialNumber.setText(str); } else if(SavePanel.isVisible()) { String str= NameTF.getText(); str= str.subString(0, str.length()-1); NameTF.setText(str); } else if(ContactPanel.isVisible()) { index++; search(index,’*’); } else if(LogPanel.isVisible()) { LogPanel.setVisble(false); index2 = 1; viewNotes(); NotesPanel.setVisible(true); } else if(NotesPanel.isVisible()) { index++; viewNotes(); }
  • 30. else if(EditNotesPanel.isVisble()) { String str= NoteTA2.getText(); NoteTA2.setText(str.substring(0,str.length()-1)); } else if(Calcpanel.isVisible()) { String str; if(index4 == 1) { str= OperandTF.getText(); OperandTF.setText(str.substring(0,str.length()-1)); } if(index4 == 2) { str= Operand2TF.getText(); Operand2TF.setText(str.substring(0,str.length()-1)); } } else if(ImagesPanel.isVisible()) { if(icon1.isEnabled()) { icon1.setEnabled(true); icon2.setEnabled(false); icon1L.setEnabled(true); icon2L.setEnabled(false); }
  • 31. if(icon2.isEnabled()) { icon2.setEnabled(true); icon3.setEnabled(false); icon2L.setEnabled(true); icon3L.setEnabled(false); } if(icon3.isEnabled()) { icon3.setEnabled(true); icon4.setEnabled(false); icon3L.setEnabled(true); icon4L.setEnabled(false); } if(icon4.isEnabled()) { icon4.setEnabled(true); icon1.setEnabled(false); icon4L.setEnabled(true); icon1L.setEnabled(false); } } } private void OK ActionPerformed(java.awt.event.ActionEvent evt){ if(DailPanel.isVisible()) { String n = DailNumber.getNumber(); NumberTF.setText(n); DailPanel.setVisible(false);
  • 32. SavePanel.setVisible(true); NameTF.setText(””); } else if(SavePanel.isVisible()) { String name=NameTf.getText(); String num= NumberTF.getText(): try { Class.forName(“java.sql.Driver”); Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”; Connection conn=DriverManager.getConnection(database,”root”, ”wxyz”); Statement stmt= conn.createStatement(); String sql=“INSERT INTO Contacts VALUES(’”+name+”’,”+num+”)”; stmt.executeUpdate(sql); SavePanel.setVisible(false); MainPanel.setVisible(true); stmt.close(); conn.close(); } catch(Exception e){ JOptionPane.showMessageDialog(null,””+e); } }
  • 33. else if(MainPanel.isVisible()) { MainPanel.setVisible(false); ContactPanel.setVisible(true); index=1; search(index,’*’); } else if(ContactPanel.isVisible()) { ContactPanel.setVisible(false); DailPanel2.setVisible(true); try { long num=0; num= Long.parseLong(NumberTF2.getText()); dial(num); } catch(Exception e) { DailNumber2.setText(“Invalid Number”) JOptionPane.showMessageDialog(n ull,””+e); } } else if(NotesPanel.isVisible()) {NotesPanel.setVisible(false); EditNotesPanel.setVisible(true); }
  • 34. else if(EditNotesPanel.isVisible()) { try {Class.forName(“java.sql.Driver”); Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”; Connection conn=DriverManager.getConnection(database,”root”, ”wxyz”); Statement stmt= conn.createStatement(); String sql=“INSERT INTO Notes VALUES(’”+DateTF.getText()+”’,”+NotesTF.getText()+”)” ; stmt.executeUpdate(sql); EditNotesPanel.setVisible(false); MainPanel.setVisible(true); stmt.close(); conn.close(); } catch(Exception e){ JOptionPane.showMessageDialog(null,””+e); } } else if(Calcpanel.isVisible()) { calcResult(); index4= 1; }
  • 35. else if(ImagesPanel.isVisible()) { ImagesPanel.setVisible(false); ImagesPanel2.setVisible(true); if(!icon1.isEnabled()) ImgL.setIcon(new ImagesIcon(“scrImage1.jpg)); else if(!icon2.isEnabled()) ImgL.setIcon(new ImagesIcon(“scrImage2.jpg)); else if(!icon3.isEnabled()) ImgL.setIcon(new ImagesIcon(“scrImage3.jpg)); else if(!icon4.isEnabled()) ImgL.setIcon(new ImagesIcon(“scrImage4.jpg)); } } //user-defined method
  • 36. private void Search ActionPerformed(java.awt.event.ActionEvent evt){ try { Class.forName(“java.sql.Driver”); Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”; Connection conn=DriverManager.getConnection(database,”root”, ”wxyz”); Statement stmt= conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); String sql=“SELECT * FROM Contacts”; if(option!=‘*’) Sql+=“WHERE name like’”+option+”%’” sql+=“order by name”; ResultSet rs = stmt.executeQuery(sql); for(int i =0;i<n;i++) { if(rs.isLast()) { rs.first(); } else rs.next(); }
  • 37. NameTF2.setText(rs.getString(“name”)); NumberTF2.setText(rs.getString(“number”)); } catch(Exception e) {NameTF2.setText(“Not found”); JOptionPane.showMessageDialog(null,””+e); } } private void Left ActionPerformed(java.awt.event.ActionEvent evt){ try { Class.forName(“java.sql.Driver”); Stringdatabase=“jdbc:mysql://localhost:3306/Mobile”; Connection conn=DriverManager.getConnection(database,”root”, ”wxyz”); Statement stmt= conn.createStatement(); if(MainPanel.isVisible()) {MainPanel.setVisible(false); ImagesPanel.setVisible(true); } else if(DialPanel.isVisible()) {DailPanel.setVisible(false); long num= 0; DailPanel.setVisible(true);
  • 38. try {num= Long.parseLong(DialNumber.getText()); dail(num); } catch(Exception e) { { DialNumber2.setText(“Invalid Number”); JOptionPane.showMessageDialog(null, “”+e); } } else if(ContactPanel.isVisible()) { String name=NameTF2.getText(); int num=Integer.parseInt(NumberTF2.getText()); String sql=“DELETE FROM Contacts WHERE name=+”’AND number=”+num; stmt.executeUpdate(sql); MainPanel.setVisible(true); ContactPanel.setVisible(false); } else if(SavePanel.isVisible()) { MainPanel.setVisible(true); SavePanel.setVisible(false); } else if(LogPanel.isVisible()) { String sql=“delete FROM CallRegister”; stmt.executeUpdate(sql); { LogPanel.setVisible(false); MainPanel.setVisible(true); }
  • 39. else if(NotesPanel.isVisible()) { String text= NoteTA.getText(); String sql=“DELETE FROM Notes WHERE Text=”’+text+”’”; stmt.executeUpdate(sql); index2=1; viweNotes(); } else if(EditNotesPanel.isVisible()) { index3=1; } else if(Calcpanel.isVisible()) { index4= 1; Operand1TF.setText(“”); OperaterTF.setText(“”); Operand2TF.setText(“”); ResultTF.setText(“”); } else if(ImagesPanel.isVisible()) { ImagesPanel.setVisible(false); MainPanel.setVisible(true); } else if(ImagesPane2.isVisible()) {ImagesPane2.setVisible(false); ImagesPanel1.setVisible(true); } stmt.close(); conn.close(); }
  • 40. catch(Exception e){ JOptionPane.showMessageDialog(null,””+e); } private void Space ActionPerformed(java.awt.event.ActionEvent evt){ action(“ “); } private void LogB ActionPerformed(java.awt.event.ActionEvent evt) {MainPanel.setVisible(false); viewLog(); LogPanel.setVisible(true); } private void NotesB ActionPerformed(java.awt.event.ActionEvent evt) {MainPanel.setVisible(false); NotesPanel.setVisible(true); index2= 1; viewNotes(); } private void Enter ActionPerformed(java.awt.event.ActionEvent evt) { try { if(EditNotesPanel.isVisible()&& index3==1) { index3=2; Type.setText(“ABC…”) }
  • 41. else if(Calcpanel.isVisible()) { if (index4==1) index4= 2; else if (index4==2) index4= 3; else if (index4==3) { calcResult(); index4= 1; } } else action(“nn”); } catch(Exception e){ JOptionPane.showMessageDialog(null,””+e); } private void icon1 ActionPerformed(java.awt.event.ActionEvent evt) {ImagesPanel.setVisible(false); ImagesPanel2.setVisible(true); ImgL.setIcon(new ImagesIcon(“scrImage1.jpg));
  • 42. private void icon3 ActionPerformed(java.awt.event.ActionEvent evt) {ImagesPanel.setVisible(false); ImagesPanel2.setVisible(true); ImgL.setIcon(new ImagesIcon(“scrImage3.jpg)); } private void icon2 ActionPerformed(java.awt.event.ActionEvent evt) {ImagesPanel.setVisible(false); ImagesPanel2.setVisible(true); ImgL.setIcon(new ImagesIcon(“scrImage2.jpg)); } private void FilesB ActionPerformed(java.awt.event.ActionEvent evt) {MainPanel.setVisible(false); icon1.setSelected(true); ImagesPanel.setVisible(true); } private void icon 4 ActionPerformed(java.awt.event.ActionEvent evt) {ImagesPanel.setVisible(false); ImagesPanel2.setVisible(true); ImgL.setIcon(new ImagesIcon(“scrImage4.jpg)); }
  • 43. public static void main(String args[]) { java.awt.EventQueue.incokeLater(new Runnable()) { public void run() { new Mobile.setVisible(true); } }); }
  • 44. Database structure The database used in this application is Mobile database of MySQL. It consists of following Tables; Tables_in_mobile callregister contacts notes
  • 45. 1. Callregister Table This table stores all the details of the calls made and the time of call. Its structure is: Field Type Null Key Default Extra Name varchar (20) YES NULL Number varchar (20) YES NULL Time date YES NULL 2. Contacts Table This table stores all the details of the contacts stored. Its structure is: Field Type Null Key Default Extra Name varchar (20) YES NULL Number bigint (20) NO PRI NULL
  • 46. 3.Notes Table This table stores all the details of the notes stored. Its structure is: Field Type Null Key Defaul t Extra date date YES NULL text varchar (200) YES NULL
  • 47. B ibliography T ext B ook Of I nformatics P ractices I nternet o http://www.cbseipprojects.in Desktop S mart P hone S oftware's  Mysql  NetBeans IDE 6.0 M y I .P T eacher  Miss Gauri Mam