You are on page 1of 105

Chapter 1

Introduction To Project
We plan to develop a live chatting module based on the group http://www.orkut.com .We studied the working of orkut in detail.and tried to extract important features in our project. Basically our project works on LAN while the real orkut works on internet. But the basic idea behind it is the same.that is to provide the user with a enjoyable and good-to-look means of communication. The real orkut provide the users with lot of options such as add as a friend ,write scraps, add to crush list ,write testimonials, joining communities etcbut we plan to include only the basic

options in our project which deal with communication purpose or rather the chatting purpose . Hence our project will contain basic functions like add as friend, write scraps and uploading photo. Like in real orkut ,user will create his own account containing a unique username and password ,which he only can access .If the user is a new one then he has to fill application form containing his personal information. Then only the user can log on to the system. The user can write scrap to any member of (our project) orkut at any point of time. He is also eligible to upload the photo of his choice, which can be viewed by all the members of (our project) orkut .The album feature which is present in real orkut is not taken in our project as there is as such no need of it. Also users are allowed to upload only one photo of his choice, which will be displayed on his homepage .The user, on finding his friend as member of(our project) orkut can send a friends request to him. Now it depends on users friend whether to accept him as a friend or to reject him.this is totally in hands of the users friend!!! All the users friends will be displayed on rightmost top of our screenso that he can know who are online and who are not?The user on finding a person to be online can write scraps to him.(Even if users friend is offline, user can write scraps to himthese scraps will be viewed by users friend when he will access his account). Scraps can be written by visiting the profile of his friend and writing scraps in his scrapbook.Similarly a person can view scraps written to him in his own

scrapbookUser is eligible to delete the scraps written to him and the scraps written by him. Others scraps cant be deleted!!!!!!! If the user is currently online, then he has to refresh the page constantly so as to view the new changes made to his account(not his personal info)for eg :if new scrap is written by his friend, then the user has to refresh his scrapbook page so as to view this new scrapthus chatting can be done on orkut. The user ,at any point of time, can change his personal information or his photo!!! To implement this project, sufficient knowledge of JAVA is needed. Along with that, knowledge of socket programming and JDBC is must.

VARIOUS MODULES
Modules are nothing but division of our source codes into manageable and logical pieces . All these pieces are nothing but java source files. This is done because if any logical error occurs during execution of program, we can correct these errors quite efficiently. Also it becomes very simple for new person to understand the code. Also if we define all these functions in a singe source code ,the source code becomes too big to manage. Our project orkut is also divided into various modules .Lets discuss them one by one : 1. Orkut: When user will run our project ORKUT ,then the first frame he will encounter is the orkut homepage .There are various features on this page such as two text field, two label field and two buttons. The two text fields are of username and password, where user can enter his username and password respectively.The two buttons are of login and of new user.If the user is old one then he will type his username and password and hit the login button. 2. Login failed: If the username and password typed by the user are not with the database values, then this frame is called. 3. Welcome: This is simplest frame in all from our project. In this a message welcome to orkut will be displayed on the center of the screen. Then there is button log in below it, which takes the user to his newly created homepage. matching

4. Viewprofile: When user hits the login button from the orkuts frame, he will view this viewprofile frame. This is homepage for the user. In the center ,users profile information is displayed. . On top left hand corner there are three buttons refresh, search, logout. The refresh button will refresh the users homepage and will incorporate if any changes done to his account. The search button will take the user to searchname frame and search a given person from the database. The logout button will close the account of the user.

5. Editprofile: This frame will enable the user to change the earlier written personal information & image. 6. Friend: On hitting the view friend button from the main orkut frame, we are guided to the friend frame. . On the friend frame six friends are displayed ,two friends per row .

7. View_scrapbook: When an user hits the scrapbook button on his homepage or also from anothers profile, this frame is called. Refresh button will update the changes made to the users profile and will display the updated scrapbook frame. The person on writing the scraps will hit the submit button. Then this scrap will be registered in the database and on hitting the refresh button changes made to the database will be displayed on this scrapbook frame.

8. Searchname: When the user hits the search button on the orkut frame, this frame gets called. On top leftmost corner of this frame is home button. On clicking this button viewprofile frame will be displayed. Just below that a textfield and a search button is present. User will type the username of the person to be searched in the textfield and on clicking the search button all the database will be searched for that username value. Accordingly the result will be displayed below it.

Chapter 2
INTRODUCTION TO JAVA
The Java Story
Back in 1990, a gentleman by the name of James Gosling was given the task of creating programs to control consumer electronics. Gosling and his team of people at Sun Microsystems started designing their software using C++, the language that most programmers were praising as the next big thing because of its object-oriented nature. Gosling, however, quickly found that C++ was not suitable for the projects he and his team had in mind. They ran into trouble with complicated aspects of C++ such as multiple inheritances of classes and with program bugs such as memory leaks. Gosling soon decided that he was going to have to come up with his own, simplified computer language that would avoid all the problems he had with C++.

Details Description of Technology Used


(JSP) Java Server Pages : JSP is a technology that works on any web or application server. It separates the application logic from the presentation logic. Allows fast development and testing. Simplifies the process of developing interactive web based applications. JSP allows you to combine the HTML webpage with pieces of java code with the same document. The java code is surrounded special tags that tell the JSP container that it should use the code to generate a Servlet, or part of one. The benefit of JSPs is that you can maintain a single document that represents both the page and the java code that enables it. The downside is that the maintainer of the JSP page must be skilled in both HTML and Java . JAVA (Struts ): In a standard JavaEE web application, the client will typically submit information to the server via a web form. The information is then either handed over to a Java servlet which processes it, interacts with a database and produces an HTML-formatted response, or it is
4

given to a Java Server Pages (JSP) document which intermingles HTML and Java code to achieve the same result. Both approaches are often considered inadequate for large projects because they mix application logic with presentation and make maintenance difficult. The goal of Struts is to cleanly separate the model (application logic that interacts with a database) from the view (HTML pages presented to the client) and the controller (instance that passes information between view and model). Struts provides the controller(a Servlet known as ActionServlet) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT and Velocity are also supported). The web

application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml which binds together model, view and controller. Requests from the client are sent to the controller in the form of "Actions defined in the configuration file; if the controller receives such a request it calls the corresponding Action class which interacts with the application specific model code. The model code returns an "ActionForward", a string telling the controller which output page to send to the client. Information is passed between model and view in the form of special JavaBeans. A powerful custom tag library allows it to read and write the content of presentation layer without the need for any embedded Java code. Struts also supports I18N (internationalization),provides facilities for the validation of data submitted by web forms, and includes a template mechanism called "Tiles" which (for instance) allows the presentation layer to be composed from independent header, footer, and content components. JAVA SCRIPT: Java script was developed by Netscape, it is object scripting language used web pages and server applications. JavaScript is a dynamic scripting language supporting prototype based object construction. Function as both a procedural and an language. Objects are created programmatically in JavaScript, by attaching methods and properties to otherwise empty objects at run time.. Objects are used as a blueprint (or prototype) for creating similar objects. these beans from the

JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation, object introspection (via for

... in),

and source code recovery (JavaScript programs bodies back into their source text) The first time JSP is loaded by the JSP container, the Servlet code necessary to fulfill the JSP tags is automatically generated, compiled and loaded into the Servlet container. The static portion of the HTML page are produced by sending static string objects to write().
JDBC (Java Data Base Connectivity) :

JDBC is an AP I( Application Programming Interface) which consists of a set of java classes, interfaces and exceptions and specifications to which both JDBC drivers, vendors and JDBC developers and here when developing applications. JDBC is a very popular data access standard RDBMS(relational database management systems) or third party vendors develop driver which adhere to the JDBC specifications. Other developers use this drivers to develop applications which access those databases. since the drivers adhere to JDBC specifications, the JDBC application developer can replace one driver for there application JDBC Driver Types with another..

JDBC Type I Driver : they are JDBC ODBC bridge driver. They delegate the work of data access to ODBC API they are slowest of all sun provides a JDBC ODBC driver implementation.

JDBC Type II Driver : they mainly use native API for data access and provide java wrapper classes to able to invoked using JDBC driver.

JDBC Type III Diver :

they are written in 100% in java and use vendor

independent net protocol to access a vendor independent remote listener. this listener in turn maps the vendor independent calls to vendor dependent ones. This extra adds complexity and decreases the data access efficiency. JDBC Type IV Driver : they are written in100% java and are the most efficient among all driver types.

Chapter 3
Requirement Analysis
This is the most crucial phase for the whole project, here project team along with the customer makes a detailed list of user requirements. The project team chalks out the functionality and limitations(if there are any) of the software they are developing, in detail. The document which contains all this information is called SRS, and it clearly and unambiguously indicates the requirements. A small amount of top-level analysis and design is also documented. This document is verified and endorsed by the customer before starting the project. SRS serves as the input for further phases.

REQUIREMENT SPECIFICATIONS
Interface Requirements: The interface for this system will be a window based software and a database system which can handle huge amount of data as records. User Interface: The user interface for this Materials Resource Planning System will be forms that can be generated by Visual Basic, HTML, java-awt, etc. Hardware Interface: The minimum hardware required in the making of the software is network based system with Pentium Processor, 128 MB RAM, 512 KB Cache Memory,5 GB Disk Space, basic input, output devices. Software Interface: The software, obviously relates to the various kinds of software required in the successful completion of the project. The software required for the completion of this project are

Oracle (RDBMS) Oracle is used as backend for the project and visual basic as the front end. Performance Requirements: The Materials Resource Management System requires a high speed Processor and error free software for fast and accurate processing of the system. Logical Database Requirements: A good Database must be installed which has the capacity of storing the large number of records and high accessibility. Software System Attributes: Some of the Attributes of the system includes: Reliability Portability Security High availability Maintainability

SPECIFIC REQUIREMENTS:
Interface Requirements: The interfaces for this system will interactive software, Java and a database system which can handle huge amount of data as records. User Interface: The user interface for this RRO System will be a Java and forms that can be generated by java-awt, etc. Hardware Interface:

The minimum hardware required is Pentium 133MHZ Processor, 64MB RAM, 20GB Disk Space, basic input, output devices. Software Interface: The software interface for this system will be any Windows Operating System, Java JDK1.2.2 OR I.3, ODBC data sources and JDBC-ODBC drivers ACCESS Database.

Chapter 4
Design Phase
Using SRS as input, system design is done. System design included designing of software and hardware i.e. functionality of hardware and software is separated-out. After separation design of software modules is done.The design process translates requirements into representation of the software that can be assessed for quality before generation of code begins. At the same time test plan is prepared, test plan describes the various tests which will be carried out on the system after completion of development. EXPLANATION OF DFD A data flow diagram (DFD) is a graphical representation of the "flow" of data through an information system, modeling its process aspects. Often they are a preliminary step used to create an overview of the system which can later be elaborated. DFDs can also be used for the visualization of data processing (structured design). A DFD shows what kinds of information will be input to and output from the system, where the data will come from and go to, and where the data will be stored. It does not show information about the timing of processes, or information about whether processes will operate in sequence or in parallel.Some of the symbol used in dfd are as follows

10

DFD OF ORKUT

11

CHAPTER 5
SOURCE CODE
//PACAKAGE KSM.MULTISERVER import java.io.*; import java.net.*; import java.sql.*; public class MultiServer { private ServerSocket Server; private Socket Client; private int ConnectionCounter; private int Port; public MultiServer() { ConnectionCounter=0; Port=5000 Init(); } public void Init() { try {
12

Server=new ServerSocket(4444); System.out.println("Waiting For Connection "+Server.getInetAddress().getHostName()); System.out.println("Listening on port: "+Server.getLocalPort()); while(true) { WaitingForConnection(); CreateThread(); }} catch(Exception e) { }} public void CreateThread() { try { ConnectionCounter++; new ServerThread(Client,ConnectionCounter); } catch(Exception e) { } return; }
13

public void WaitingForConnection() { try { do { Client=Server.accept(); } while(Client==null); } catch(Exception e) { }} public static void main(String a[]) { new MultiServer(); }} //WELCOME import java.awt.*; import java.awt.event.*; import javax.swing.*; public class welcome extends JFrame {
14

String user1; private JLabel jLabel1; private JButton jButton1; private JPanel contentPane; public welcome(String user) { super(); user1=user; JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) { } initializeComponent(); this.setVisible(true); } private void initializeComponent() { jLabel1 = new JLabel();
15

jButton1 = new JButton(); contentPane = (JPanel)this.getContentPane(); jButton1.setText("GET IN"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); contentPane.setLayout(null); contentPane.setBackground(new Color(140, 152, 236)); addComponent(contentPane, jLabel1, 347,158,289,117); addComponent(contentPane, jButton1, 452,319,83,28); jLabel1.setIcon(new ImageIcon("c:/orkut_java/photos/untitled1.jpg")); jLabel1.setText("WELCOME TO ORKUT!!!"); this.setTitle("welcome - extends JFrame"); this.setLocation(new Point(0, 0)); this.setSize(new Dimension(1366, 768)); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c); }
16

private void jButton1_actionPerformed(ActionEvent e) { new viewprofile(user1); this.setVisible(false); } //ORKUT import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class orkut extends JFrame { private JLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4; private JTextField jTextField1; private JPasswordField jPasswordField1; private JButton jButton1; private JButton jButton2; private JPanel contentPane; public static String currentuser; public static String viewname;
17

public orkut() { super(); initializeComponent(); this.setVisible(true); } private void initializeComponent() { jLabel1 = new JLabel(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); jLabel4 = new JLabel(); jTextField1 = new JTextField(); jPasswordField1 = new JPasswordField(); jButton1 = new JButton(); jButton2 = new JButton(); contentPane = (JPanel)this.getContentPane(); new Client("photo"+"us-photo-true"); new Client("photo"+"orkut-only"); jLabel1.setBackground(new Color(196, 212, 242)); jLabel1.setOpaque(true); jLabel1.setText("USERNAME"); jLabel2.setBackground(new Color(196, 212, 242));
18

jLabel2.setOpaque(true); jLabel2.setText("PASSWORD"); jLabel3.setIcon(new ImageIcon("c:/orkut_java/photos/us-photo-true.jpg")); jLabel4.setIcon(new ImageIcon("c:/orkut_java/photos/orkut-only.jpg")); jTextField1.setBackground(new Color(255, 255, 153)); jTextField1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jTextField1_actionPerformed(e); } }); jPasswordField1.setBackground(new Color(255, 255, 153)); jPasswordField1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jPasswordField1_actionPerformed(e); } }); jButton1.setText("login"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); jButton2.setText("new user");
19

jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } }); contentPane.setLayout(null); contentPane.setBackground(new Color(196, 212, 242)); addComponent(contentPane, jLabel1, 722,192,71,20); addComponent(contentPane, jLabel2, 721,253,74,18); addComponent(contentPane, jLabel3, 74,111,600,400); addComponent(contentPane, jLabel4, 0,10,1024,60); addComponent(contentPane, jTextField1, 807,191,167,22); addComponent(contentPane, jPasswordField1, 808,251,164,22); addComponent(contentPane, jButton1, 781,315,83,22); addComponent(contentPane, jButton2, 879,315,90,22); this.setTitle("orkut - extends JFrame"); this.setLocation(new Point(0, 0)); this.setSize(new Dimension(1366,768 )); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c);
20

} //LOGIN import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.applet.*; public class login extends JFrame { private login2 nextframe; private JLabel lang; private JLabel relig; private JLabel eid; private JLabel humour; private JLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4; private JLabel jLabel5; private JTextField jTextField3; private JPasswordField jPasswordField1; private JPasswordField jPasswordField2; private JTextField jTextField8;
21

private JComboBox jComboBox1; private JComboBox month; private JComboBox year; private JComboBox day; private JButton check; private JButton create; private JButton cancel; private JButton image; private JLabel title; private JLabel dob; private JLabel inte; private JCheckBox friends; private JCheckBox activity; private JCheckBox buisnet; private JCheckBox h1; private JCheckBox h2; private JCheckBox h3; private JCheckBox h4; private JCheckBox h5; private JCheckBox h6; private JCheckBox h7; private JTextField tlang; private JTextField trelig;
22

private JTextField teid; private JPanel contentPane; public login() { super(); JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) { } //LOGIN FAILED import java.awt.*; import java.awt.event.*; import javax.swing.*; public class login_failed extends JFrame { private JTextPane jTextPane4; private JButton jButton1; private JPanel contentPane;
23

public login_failed() { super(); JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); } catch (Exception ex) { } initializeComponent(); this.setVisible(true); } private void initializeComponent() { jTextPane4 = new JTextPane(); jButton1 = new JButton(); contentPane = (JPanel)this.getContentPane(); jTextPane4.setBackground(new Color(204, 204, 204)); jTextPane4.setDisabledTextColor(new Color(232, 16, 16)); jTextPane4.setForeground(new Color(215, 12, 12));

24

jTextPane4.setText(" USERNAME OR PASSWORD NOT MATCHING PLEASE TRY AGAIN!!!!!!!!!!!!!!!"); jTextPane4.setEditable(false); jButton1.setBackground(new Color(94, 106, 232)); jButton1.setText("OK"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); contentPane.setLayout(null); contentPane.setBackground(new Color(140, 152, 236)); addComponent(contentPane, jTextPane4, 36,62,292,45); addComponent(contentPane, jButton1, 137,186,89,40); this.setTitle("login_failed - extends JFrame"); this.setLocation(new Point(40, 102)); this.setSize(new Dimension(390, 300)); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c);

25

} //VIEW PROFILE import java.awt.*; import java.awt.event.*; import javax.swing.*; public class viewprofile1 extends JFrame { public JLabel jLabel1; public JLabel jLabel2; public JLabel jLabel3; public JLabel jLabel4; public JLabel jLabel5; public JLabel jLabel6; public JLabel jLabel7; public JLabel jLabel8; private JButton jButton1; public JEditorPane passion; public JScrollPane passion1; public JEditorPane books; public JScrollPane books1; public JEditorPane movies; public JScrollPane movies1; public JTextField jTextField4;
26

public JTextField jTextField5; public JTextField jTextField6; public JTextField jTextField7; public JTextField jTextField8; public JPanel contentPane; viewprofile pre1; view_others pre2; public int flag; public viewprofile1() { } public viewprofile1(viewprofile pre) { super(); pre1=pre; flag=0; JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) {
27

} initializeComponent(); this.setVisible(false); } public viewprofile1(view_others pre) { super(); pre2=pre; flag =1; JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) { } initializeComponent(); this.setVisible(false); } private void initializeComponent() {
28

jLabel1 = new JLabel(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); jLabel4 = new JLabel(); jLabel5 = new JLabel(); jLabel6 = new JLabel("Pets"); jLabel7 = new JLabel("Drinking"); jLabel8 = new JLabel("Smoking"); jButton1=new JButton("Back"); passion = new JEditorPane();

passion1 = new JScrollPane(); books books1 movies movies1 = new JEditorPane(); = new JScrollPane(); = new JEditorPane(); = new JScrollPane();

jTextField4 = new JTextField(); jTextField5 = new JTextField(); jTextField6 = new JTextField(); jTextField7 = new JTextField(); jTextField8 = new JTextField(); passion1.setViewportView(passion); books1.setViewportView(books); movies1.setViewportView(movies);
29

contentPane = (JPanel)this.getContentPane(); passion.setEditable(false); books.setEditable(false); movies.setEditable(false); jTextField4.setEditable(false); jTextField5.setEditable(false); jTextField6.setEditable(false); jTextField7.setEditable(false); jTextField8.setEditable(false); jLabel1.setText("Passion"); jLabel2.setText("Books"); jLabel3.setText("Movies"); jLabel4.setText("Living"); jLabel5.setText("Fashion"); jTextField4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jTextField4_actionPerformed(e); } }); jTextField5.addActionListener(new ActionListener() {
30

public void actionPerformed(ActionEvent e) { jTextField5_actionPerformed(e); }} //SEARCH NAME import java.awt.*; import java.awt.event.*; import javax.swing.*; public class searchname extends JFrame { private JLabel jLabel2 private JLabel jLabel3 ; private JTextField jTextField1; private JTextPane jTextPane1 ; private JTextPane jTextPane2 ; private JButton private JButton private JButton jButton1 ; jButton2 ; jButton3 ;

private JPanel contentPane ; public searchname()


31

{ super(); JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); } catch (Exception ex) { } initializeComponent(); } }); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); contentPane.setLayout(null); contentPane.setBackground(new Color(158, 168, 237)); addComponent(contentPane, jLabel1, 36,97,86,26); addComponent(contentPane, jLabel2, 34,238,60,18); addComponent(contentPane, jLabel3, 33,373,60,18);
32

addComponent(contentPane, jLabel4, 31,440,60,18); addComponent(contentPane, jLabel5, 30,484,60,18); addComponent(contentPane, jLabel6, 30,527,60,18); addComponent(contentPane, jLabel7, 30,567,60,18); addComponent(contentPane, jLabel8, 30,612,60,18); addComponent(contentPane, passion1, 237,59,350,96); addComponent(contentPane, books1, 236,189,350,96); addComponent(contentPane, movies1, 236,320,350,98); addComponent(contentPane, jTextField4, 237,440,350,22); addComponent(contentPane, jTextField5, 237,484,350,22); addComponent(contentPane, jTextField6, 237,527,350,22); addComponent(contentPane, jTextField7, 237,567,350,22); addComponent(contentPane, jTextField8, 237,612,350,22); addComponent(contentPane, jButton1, 456,654,74,25); passion.setBackground(new Color(161,247,241)); books.setBackground(new Color(244, 195, 103)); movies.setBackground(new Color(239,122,247)); jTextField4.setBackground(new Color(161,247,241)); jTextField5.setBackground(new Color(244, 195, 103)); jTextField6.setBackground(new Color(239,122,247)); jTextField7.setBackground(new Color(161,247,241)); jTextField8.setBackground(new Color(244, 195, 103)); this.setTitle("viewprofile1 - extends JFrame");
33

this.setLocation(new Point(0, 0)); this.setSize(new Dimension(1366, 768)); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c); } private void jTextField4_actionPerformed(ActionEvent e) { } private void jTextField5_actionPerformed(ActionEvent e) { } private void jButton1_actionPerformed(ActionEvent e) { this.setVisible(false); if(flag==0) pre1.setVisible(true); else pre2.setVisible(true); } //EDIT PROFILE
34

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; public class editprofile2 extends JFrame { private JLabel lfname; private JLabel llname; private JLabel labtme; private JLabel lpassion; private JLabel lbooks; private JLabel lmovies; private JLabel lfashion; private JLabel lliving; private JLabel lsmoking; private JLabel ldrink; private JLabel lpet; private JButton update; private JButton back; public JTextField fname; public JTextField lname; public JEditorPane abtme; public JScrollPane abtme1;
35

public JEditorPane passion; public JScrollPane passion1; public JEditorPane books; public JScrollPane books1; public JEditorPane movies; public JScrollPane movies1; public JCheckBox jCheckBox1; public JCheckBox jCheckBox2; public JCheckBox jCheckBox3; public JCheckBox jCheckBox4; public JCheckBox jCheckBox5; public JCheckBox jCheckBox6; public JCheckBox jCheckBox7; public JComboBox jComboBox1; public JComboBox jComboBox2; public JComboBox jComboBox3; private JPanel contentPane; private String str; private String user; private editprofile pframe; public editprofile2() { }
36

public editprofile2(editprofile preframe,String username) { super(); pframe=preframe; user=username; JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) { } initializeComponent(); this.setVisible(false); } private void initializeComponent() { fname lname abtme abtme1 = new JTextField(); = new JTextField(); = new JEditorPane(); = new JScrollPane();
37

passion

= new JEditorPane();

passion1 = new JScrollPane(); books books1 movies movies1 = new JEditorPane(); = new JScrollPane(); = new JEditorPane(); = new JScrollPane();

jCheckBox1 = new JCheckBox("with partner"); jCheckBox2 = new JCheckBox("alone"); jCheckBox3 = new JCheckBox("with parents"); jCheckBox4 = new JCheckBox("urban (fresh style)"); jCheckBox5 = new JCheckBox("classic (Formal)"); jCheckBox6 = new JCheckBox("alternative"); jCheckBox7 = new JCheckBox("contemporary"); jComboBox1 = new JComboBox(); jComboBox2 = new JComboBox(); jComboBox3 = new JComboBox(); update back =new JButton("update"); =new JButton("back");

passion1.setViewportView(passion); books1.setViewportView(books); movies1.setViewportView(movies); abtme1.setViewportView(abtme); lfname=new JLabel("First Name:");


38

llname=new JLabel("Last Name"); labtme=new JLabel("About Me"); lpassion=new JLabel("Passion"); lbooks=new JLabel("Books"); lmovies=new JLabel("Movies"); lfashion=new JLabel("Fashion"); lliving=new JLabel("Living"); lsmoking=new JLabel("Smokiong"); ldrink=new JLabel("Drinking"); lpet=new JLabel("Pets"); contentPane = (JPanel)this.getContentPane(); Client c=new Client ("select first from logins where username='"+user+"';"); String str=c.strrecv; str=str.trim(); fname.setText(str); c.Processing("select last from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); lname.setText(str); c.Processing("select passion from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); passion.setText(str);
39

c.Processing("select movie from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); movies.setText(str); c.Processing("select abtme from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); abtme.setText(str); c.Processing("select book from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); books.setText(str); c.Processing("select living from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); if(str.indexOf("alone")>=0) jCheckBox2 = new JCheckBox("alone",true); else jCheckBox2 = new JCheckBox("alone",false); if(str.indexOf("with partner")>=0) jCheckBox1 = new JCheckBox("with partner",true); else jCheckBox1 = new JCheckBox("with partner",false);
40

if(str.indexOf("with parents")>=0) jCheckBox3 = new JCheckBox("with parents",true); else jCheckBox3 = new JCheckBox("with parents",false); c.Processing("select fashion from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); if(str.indexOf("urban (fresh style)")>=0) jCheckBox4 = new JCheckBox("urban (fresh style)",true); else jCheckBox4 = new JCheckBox("urban (fresh style)",false); if(str.indexOf("classic (Formal)")>=0) jCheckBox5 = new JCheckBox("classic (Formal)",true); else jCheckBox5 = new JCheckBox("classic (Formal)",false); if(str.indexOf("alternative")>=0) jCheckBox6 = new JCheckBox("alternative",true); else jCheckBox6 = new JCheckBox("alternative",false); if(str.indexOf("contemporary")>=0) jCheckBox7 = new JCheckBox("contemporary",true); else jCheckBox7 = new JCheckBox("contemporary",false);
41

jCheckBox1.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { jCheckBox1_itemStateChanged(e); } }); jCheckBox2.addItemListener(new ItemListener(){ public void itemStateChanged(ItemEvent e) { jCheckBox2_itemStateChanged(e); }}); jCheckBox3.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { jCheckBox3_itemStateChanged(e); } }); jCheckBox4.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { jCheckBox4_itemStateChanged(e); }}); jCheckBox5.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { jCheckBox5_itemStateChanged(e); }}); jCheckBox6.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { jCheckBox6_itemStateChanged(e);
42

} }); jCheckBox7.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { jCheckBox7_itemStateChanged(e); } }); jComboBox1.addItem("no answer"); jComboBox1.addItem("I love my pet(s)"); jComboBox1.addItem("I like them at zoos"); jComboBox1.addItem("I dont like pets"); jComboBox1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jComboBox1_actionPerformed(e); } }); update.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { update_actionPerformed(e); } }); back.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ back_actionPerformed(e); }}); jComboBox2.addItem("no answer"); jComboBox2.addItem("no");
43

jComboBox2.addItem("socially"); jComboBox2.addItem("occasionally"); jComboBox2.addItem("regularly"); jComboBox2.addItem("trying to quit"); jComboBox2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ jComboBox2_actionPerformed(e); } }); jComboBox3.addItem("no answer"); jComboBox3.addItem("no"); jComboBox3.addItem("socially"); jComboBox3.addItem("occasionally"); jComboBox3.addItem("regularly"); jComboBox3.addItem("trying to quit"); jComboBox3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ jComboBox3_actionPerformed(e); }}); c.Processing("select pets from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); if(str.equals("no answer")) jComboBox1.setSelectedIndex(0);
44

else if(str.equals("I love my pet(s)")) jComboBox1.setSelectedIndex(1); else if(str.equals("I like them at zoos")) jComboBox1.setSelectedIndex(2); else jComboBox1.setSelectedIndex(3); c.Processing("select drink from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); if(str.equals("no answer")) jComboBox2.setSelectedIndex(0); else if(str.equals("no")) jComboBox2.setSelectedIndex(1); else if(str.equals("socially")) jComboBox2.setSelectedIndex(2); else if(str.equals("occasionally")) jComboBox2.setSelectedIndex(3); else if(str.equals("regularly")) jComboBox2.setSelectedIndex(4); else jComboBox2.setSelectedIndex(5); c.Processing("select smok from logins where username='"+user+"';"); str=c.strrecv; str=str.trim(); if(str.equals("no answer"))
45

jComboBox3.setSelectedIndex(0); else if(str.equals("no")) jComboBox3.setSelectedIndex(1); else if(str.equals("socially")) jComboBox3.setSelectedIndex(2); else if(str.equals("occasionally")) jComboBox3.setSelectedIndex(3); else if(str.equals("regularly")) jComboBox3.setSelectedIndex(4); else jComboBox3.setSelectedIndex(5); contentPane.setLayout(null); addComponent(contentPane, fname, 242,5,100,22); addComponent(contentPane, lfname, 40,5,100,22); addComponent(contentPane, lname, 242,33,100,22); addComponent(contentPane, llname, 40,33,100,22); addComponent(contentPane, abtme1, 242,65,350,75); addComponent(contentPane, labtme, 40,65,350,75); addComponent(contentPane, passion1, 242,150,350,75); addComponent(contentPane, lpassion, 40,150,350,75); addComponent(contentPane, books1, 242,235,350,75); addComponent(contentPane, lbooks, 40,235,350,75); addComponent(contentPane, movies1, 242,320,350,75); addComponent(contentPane, lmovies, 40,320,350,75);
46

addComponent(contentPane, jCheckBox1, 399,406,96,24); addComponent(contentPane, jCheckBox2, 242,406,96,24); addComponent(contentPane, lliving, 40,406,96,24); addComponent(contentPane, jCheckBox3, 241,438,96,24); addComponent(contentPane, jCheckBox4, 241,467,150,24); addComponent(contentPane, jCheckBox6, 400,467,96,24); addComponent(contentPane, lfashion, 40,467,96,24); addComponent(contentPane, jCheckBox5, 241,502,150,24); addComponent(contentPane, jCheckBox7, 400,502,96,24); addComponent(contentPane, jComboBox1, 243,553,184,22); addComponent(contentPane, lpet, 40,553,184,22); addComponent(contentPane, jComboBox2, 244,595,139,22); addComponent(contentPane, ldrink, 40,595,139,22); addComponent(contentPane, jComboBox3, 245,640,137,22); addComponent(contentPane, lsmoking, 40,640,137,22); addComponent(contentPane, update, 200,680,75,22); addComponent(contentPane, back, 100,680,75,22); contentPane.setBackground(new Color(158, 168, 237)); fname.setBackground(new Color(241, 245, 31)); lname.setBackground(new Color(241, 245, 31)); abtme.setBackground(new Color(224, 249, 162)); passion.setBackground(new Color(161,247,241)); books.setBackground(new Color(244, 195, 103));
47

movies.setBackground(new Color(239,122,247)); jCheckBox1.setBackground(new Color(81,240,106)); jCheckBox2.setBackground(new Color(81,240,106)); jCheckBox3.setBackground(new Color(81,240,106)); jCheckBox4.setBackground(new Color(239,122,247)); jCheckBox5.setBackground(new Color(239,122,247)); jCheckBox6.setBackground(new Color(239,122,247)); jCheckBox7.setBackground(new Color(239,122,247)); update.setBackground(new Color(59,235,54)); this.setTitle("editprofile2 - extends JFrame"); this.setLocation(new Point(0, 0)); this.setSize(new Dimension(1366, 768)); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c); } private void jCheckBox1_itemStateChanged(ItemEvent e) { } private void jCheckBox2_itemStateChanged(ItemEvent e) {
48

} private void jCheckBox3_itemStateChanged(ItemEvent e) { } private void jCheckBox4_itemStateChanged(ItemEvent e) { } private void jCheckBox5_itemStateChanged(ItemEvent e) { } private void jCheckBox6_itemStateChanged(ItemEvent e) { } private void jCheckBox7_itemStateChanged(ItemEvent e) { } private void jComboBox1_actionPerformed(ActionEvent e) { Object o = jComboBox1.getSelectedItem(); } private void jComboBox2_actionPerformed(ActionEvent e) { Object o = jComboBox2.getSelectedItem();
49

} private void jComboBox3_actionPerformed(ActionEvent e) { Object o = jComboBox3.getSelectedItem(); } private void update_actionPerformed(ActionEvent e) { String temp=new String(); String temppara=new String(); logins(fname,lname,abtme,passion,book,movies,living,fashion,pets,drink,smok) values('"; for(int i=0;i<11;i++) { switch(i) { case 0:str=fname.getText(); temppara="first"; break; case 1:str=lname.getText(); temppara="last"; break; case 2:str=abtme.getText(); str=str.trim(); temppara="abtme"; break;
50

case 3:str=passion.getText(); temppara="passion"; break; case 4:str=books.getText(); temppara="book"; break; case 5:str=movies.getText(); temppara="movie; break; case 6:temp=((!jCheckBox1.isSelected())?"":"with partner,"); str=""; str=str+temp; temp=((!jCheckBox2.isSelected())?"":"alone,"); str=str+temp; temp=((!jCheckBox3.isSelected())?"":"with parents,"); str=str+temp; temppara="living"; break; case 7:temp=((!jCheckBox4.isSelected())?"":"urban (fresh style),"); str=""; str=str+temp; temp=((!jCheckBox5.isSelected())?"":"classic (Formal),"); str=str+temp;
51

temp=((!jCheckBox6.isSelected())?"":"alternative,"); str=str+temp; temp=((!jCheckBox7.isSelected())?" ":"contemporary,"); str=str+temp; temppara="fashion"; break; case 8: Object o = jComboBox1.getSelectedItem(); temp=((o==null)? "" : o.toString()); str=""; str=str+temp; temppara="pets"; break; case 9: Object o1 = jComboBox2.getSelectedItem(); temp=((o1==null)? "" : o1.toString()); str=""; str=str+temp; temppara="drink"; break; case 10:Object o2 = jComboBox3.getSelectedItem(); temp=((o2==null)? "" : o2.toString()); str=""; str=str+temp;
52

temppara="smok"; break; } new Client("update logins set "+ temppara+ " ='"+str+"'"+"where username='"+orkut.currentuser+"';"); }

try {FileWriter f0 = new FileWriter("c:/orkut_java/file1.txt",true); f0.write(str); f0.close(); } catch(Exception e1) { new viewprofile(user); this.setVisible(false); } private void back_actionPerformed(ActionEvent e) { pframe.setVisible(true); this.setVisible(false); } //FRIEND import java.awt.*;
53

import java.awt.event.*; import javax.swing.*; public class friend extends JFrame { private JLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4; private JLabel jLabel5; private JLabel jLabel6; private JTextArea jTextArea1; private JScrollPane jScrollPane1; private JTextArea jTextArea2; private JScrollPane jScrollPane2; private JTextArea jTextArea3; private JScrollPane jScrollPane3; private JTextArea jTextArea4; private JScrollPane jScrollPane4; private JTextArea jTextArea5; private JScrollPane jScrollPane5; private JTextArea jTextArea6; private JScrollPane jScrollPane6; private JButton jButton1;
54

private JButton jButton2; private JButton jButton3; private JButton jButton4; private JButton jButton5; private JButton jButton6; private JButton jButton7; private JButton jButton8; private JButton jButton9; private JPanel contentPane; int frno; int frmax; friend[] fri; String arr[]; public friend() { } public friend(String a[],String user,friend f[],int max,int frameno) { super(); JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try

55

{ UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception ex) { } frno=frameno; frmax=max; fri=f; arr=a; initializeComponent(); if(frameno==0) this.setVisible(true); else this.setVisible(false); } private void initializeComponent() { jLabel1 = new JLabel(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); jLabel4 = new JLabel(); jLabel5 = new JLabel();

56

jLabel6 = new JLabel(); jButton1 = new JButton(); jButton2 = new JButton(); jButton3 = new JButton(); jButton4 = new JButton(); jButton5 = new JButton(); jButton6 = new JButton(); jButton7 = new JButton(); jButton8 = new JButton(); jButton9 = new JButton(); jTextArea1 = new JTextArea(); jScrollPane1 = new JScrollPane(); jTextArea2 = new JTextArea(); jScrollPane2 = new JScrollPane(); jTextArea3 = new JTextArea(); jScrollPane3 = new JScrollPane(); jTextArea4 = new JTextArea(); jScrollPane4 = new JScrollPane(); jTextArea5 = new JTextArea(); jScrollPane5 = new JScrollPane(); jTextArea6 = new JTextArea(); jScrollPane6 = new JScrollPane(); jScrollPane1.setViewportView(jTextArea1);
57

jScrollPane2.setViewportView(jTextArea2); jScrollPane3.setViewportView(jTextArea3); jScrollPane4.setViewportView(jTextArea4); jScrollPane5.setViewportView(jTextArea5); jScrollPane6.setViewportView(jTextArea6); contentPane = (JPanel)this.getContentPane(); jLabel1.setText("NO PHOTO"); jLabel2.setText("NO PHOTO"); jLabel3.setText("NO PHOTO"); jLabel4.setText("NO PHOTO"); jLabel5.setText("NO PHOTO"); jLabel6.setText("NO PHOTO"); jTextArea1.setEditable(false); jTextArea2.setEditable(false); jTextArea3.setEditable(false); jTextArea4.setEditable(false); jTextArea5.setEditable(false); jTextArea6.setEditable(false); jTextArea1.setBackground(new Color(239,122,247)); jTextArea2.setBackground(new Color(239,122,247)); jTextArea3.setBackground(new Color(239,122,247)); jTextArea4.setBackground(new Color(239,122,247)); jTextArea5.setBackground(new Color(239,122,247));
58

jTextArea6.setBackground(new Color(239,122,247)); Client c= new Client(); String[] drr=new String[5]; calcage age1 = new calcage (); drr[0]=c.Client("select first from logins where username='"+arr[0]+"'",0); drr[1]=c.Client("select last from logins where username='"+arr[0]+"'",0); drr[2]=c.Client("select dob from logins where username='"+arr[0]+"'",0); drr[3]=c.Client("select sex from logins where username='"+arr[0]+"'",0); drr[4]=c.Client("select country from logins where username='"+arr[0]+"'",0); int age=age1.calc(drr[2]); jTextArea1.setText("\n"+drr[0]+" "+drr[1]+"\n"+drr[4]+"\n"+drr[3]+","+age); jLabel1.setIcon(new ImageIcon("c:/orkut_java/photos/"+arr[0]+".jpg")); jButton1.setText(arr[0]+"("+countfr(arr[0])+")" ); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } });

if(arr[1]==null) { jButton2.setVisible(false); jLabel2.setVisible(false);


59

jTextArea2.setVisible(false); } else {jButton2.setText(arr[1]+"("+countfr(arr[1])+")"); new Client("photo"+arr[1]); jLabel2.setIcon(new ImageIcon("c:/orkut_java/photos/"+arr[1]+".jpg")); drr[0]=c.Client("select first from logins where username='"+arr[1]+"'",0); drr[1]=c.Client("select last from logins where username='"+arr[1]+"'",0); drr[2]=c.Client("select dob from logins where username='"+arr[1]+"'",0); drr[3]=c.Client("select sex from logins where username='"+arr[1]+"'",0); drr[4]=c.Client("select country from logins where username='"+arr[1]+"'",0); age=age1.calc(drr[2]); jTextArea2.setText("\n"+drr[0]+" "+drr[1]+"\n"+drr[4]+"\n"+drr[3]+","+age); } jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } }); if(arr[2]==null) { jButton3.setVisible(false); jLabel3.setVisible(false);

60

jTextArea3.setVisible(false); } else {jButton3.setText(arr[2]+"("+countfr(arr[2])+")"); jLabel3.setIcon(new ImageIcon("c:/orkut_java/photos/"+arr[2]+".jpg")); drr[0]=c.Client("select first from logins where username='"+arr[2]+"'",0); drr[1]=c.Client("select last from logins where username='"+arr[2]+"'",0); drr[2]=c.Client("select dob from logins where username='"+arr[2]+"'",0); drr[3]=c.Client("select sex from logins where username='"+arr[2]+"'",0); drr[4]=c.Client("select country from logins where username='"+arr[2]+"'",0); age=age1.calc(drr[2]); jTextArea3.setText("\n"+drr[0]+" "+drr[1]+"\n"+drr[4]+"\n"+drr[3]+","+age); } jButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton3_actionPerformed(e); } }); if(arr[3]==null) { jButton4.setVisible(false); jLabel4.setVisible(false); jTextArea4.setVisible(false);
61

} else {jButton4.setText(arr[3]+"("+countfr(arr[3])+")"); jLabel4.setIcon(new ImageIcon("c:/orkut_java/photos/"+arr[3]+".jpg")); drr[0]=c.Client("select first from logins where username='"+arr[3]+"'",0); drr[1]=c.Client("select last from logins where username='"+arr[3]+"'",0); drr[2]=c.Client("select dob from logins where username='"+arr[3]+"'",0); drr[3]=c.Client("select sex from logins where username='"+arr[3]+"'",0); drr[4]=c.Client("select country from logins where username='"+arr[3]+"'",0); age=age1.calc(drr[2]); jTextArea4.setText("\n"+drr[0]+" "+drr[1]+"\n"+drr[4]+"\n"+drr[3]+","+age); } jButton4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton4_actionPerformed(e); } }); if(arr[4]==null) { jButton5.setVisible(false); jLabel5.setVisible(false); jTextArea5.setVisible(false); }
62

Else{ jButton5.setText(arr[4]+"("+countfr(arr[4])+")"); jLabel5.setIcon(new ImageIcon("c:/orkut_java/photos/"+arr[4]+".jpg")); drr[0]=c.Client("select first from logins where username='"+arr[4]+"'",0); drr[1]=c.Client("select last from logins where username='"+arr[4]+"'",0); drr[2]=c.Client("select dob from logins where username='"+arr[4]+"'",0); drr[3]=c.Client("select sex from logins where username='"+arr[4]+"'",0); drr[4]=c.Client("select country from logins where username='"+arr[4]+"'",0); age=age1.calc(drr[2]); jTextArea5.setText("\n"+drr[0]+" "+drr[1]+"\n"+drr[4]+"\n"+drr[3]+","+age); } jButton5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton5_actionPerformed(e); } }); if(arr[5]==null) { jButton6.setVisible(false); jLabel6.setVisible(false); jTextArea6.setVisible(false); } else
63

{jButton6.setText(arr[5]+"("+countfr(arr[5])+")"); jLabel6.setIcon(new ImageIcon("c:/orkut_java/photos/"+arr[5]+".jpg")); drr[0]=c.Client("select first from logins where username='"+arr[5]+"'",0); drr[1]=c.Client("select last from logins where username='"+arr[5]+"'",0); drr[2]=c.Client("select dob from logins where username='"+arr[5]+"'",0); drr[3]=c.Client("select sex from logins where username='"+arr[5]+"'",0); drr[4]=c.Client("select country from logins where username='"+arr[5]+"'",0); age=age1.calc(drr[2]); jTextArea6.setText("\n"+drr[0]+" "+drr[1]+"\n"+drr[4]+"\n"+drr[3]+","+age); } jButton6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton6_actionPerformed(e); } }); jButton7.setText("Next"); jButton7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton7_actionPerformed(e); }}); jButton8.setText("Back"); jButton8.addActionListener(new ActionListener() {
64

public void actionPerformed(ActionEvent e) { jButton8_actionPerformed(e); } }); jButton9.setText("Home"); jButton9.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton9_actionPerformed(e); } }); contentPane.setLayout(null); contentPane.setBackground(new Color(158, 168, 237)); addComponent(contentPane, jLabel1, 150,20,100,100); addComponent(contentPane, jLabel2, 150,200,100,100); addComponent(contentPane, jLabel3, 150,380,100,100); addComponent(contentPane, jLabel4, 470,20,100,100); addComponent(contentPane, jLabel5, 470,200,100,100); addComponent(contentPane, jLabel6, 470,380,100,100); addComponent(contentPane, jTextArea1, 270,20,180,100); addComponent(contentPane, jTextArea2, 270,200,180,100); addComponent(contentPane, jTextArea3, 270,380,180,100); addComponent(contentPane, jTextArea4, 590,20,180,100); addComponent(contentPane, jTextArea5, 590,200,180,100);
65

addComponent(contentPane, jTextArea6, 590,380,180,100); addComponent(contentPane, jButton1, 150,130,100,20); addComponent(contentPane, jButton2, 150,310,100,20); addComponent(contentPane, jButton3, 150,490,100,20); addComponent(contentPane, jButton4, 470,130,100,20); addComponent(contentPane, jButton5, 470,310,100,20); addComponent(contentPane, jButton6, 470,490,100,20); addComponent(contentPane, jButton7, 300,580,83,21); addComponent(contentPane, jButton8, 400,580,83,22); addComponent(contentPane, jButton9, 500,580,86,21); this.setTitle("friend - extends JFrame"); this.setLocation(new Point(0, 0)); this.setSize(new Dimension(1366, 768)); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c); } private void jButton1_actionPerformed(ActionEvent e) { if(!(orkut.currentuser).equals(arr[0])) new view_others(arr[0]);
66

else new viewprofile(orkut.currentuser); this.setVisible(false); } private void jButton2_actionPerformed(ActionEvent e) { if(!(orkut.currentuser).equals(arr[1])) new view_others(arr[1]); else new viewprofile(orkut.currentuser);

this.setVisible(false); } private void jButton3_actionPerformed(ActionEvent e) { if(!(orkut.currentuser).equals(arr[2])) new view_others(arr[2]); else new viewprofile(orkut.currentuser); this.setVisible(false); } private void jButton4_actionPerformed(ActionEvent e) { if(!(orkut.currentuser).equals(arr[3])) new view_others(arr[3]); else new viewprofile(orkut.currentuser);
67

this.setVisible(false); } private void jButton5_actionPerformed(ActionEvent e) { if(!(orkut.currentuser).equals(arr[4])) new view_others(arr[4]); else new viewprofile(orkut.currentuser); this.setVisible(false); } private void jButton6_actionPerformed(ActionEvent e) { if(!(orkut.currentuser).equals(arr[5])) new view_others(arr[5]); else new viewprofile(orkut.currentuser); this.setVisible(false); } private void jButton7_actionPerformed(ActionEvent e) { if(frno<frmax) { fri[frno].setVisible(false); fri[frno+1].setVisible(true); }} private void jButton8_actionPerformed(ActionEvent e)
68

{ if(frno>0){ fri[frno].setVisible(false); fri[frno-1].setVisible(true); }} private void jButton9_actionPerformed(ActionEvent e) { new viewprofile(orkut.currentuser); fri[frno].setVisible(false); } int countfr(String user) { Client d=new Client("frien"+user); int start1=0; int friends1=0; if(d.strrecv!=null) { int last1=d.strrecv.length();

int temp2; while(start1<last1){ if((temp2=d.strrecv.indexOf("$",start1))!=-1) { friends1++;


69

start1=temp2+1; } start1++; }} return friends1; } // VIEW SCRAP import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Date; public class view_scrapbook extends JFrame { private JLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4; private JTextArea jTextArea2; private JScrollPane jScrollPane3; private JTextArea jTextArea3; private JScrollPane jScrollPane4; private JTextArea jTextArea4;
70

private JScrollPane jScrollPane5; private JTextArea jTextArea5; private JScrollPane jScrollPane6; private JButton jButton1; private JButton jButton2; private JButton jButton3; private JButton jButton4; private JButton jButton5; private JButton jButton6; private JButton jButton7; private JButton jButton8; private JButton jButton9; private JButton jButton10; private JButton jButton11; private JButton jButton12; private JButton jButton13; private JPanel contentPane;

public view_scrapbook aa[]; public int number; public int maxscrap; public int max; String name;
71

public view_scrapbook(String str11,String str22,String str33,view_scrapbook a[],int num,int maxx,String name1) { super(); aa=a; number=num; maxscrap=maxx; if (maxx==0) max=1; else if(maxx%3==0) max=maxx/3; else max=maxx/3+1; name=name1; JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); } catch (Exception ex) { new serverdown();

72

} initializeComponent(str11,str22,str33); if(num==0) this.setVisible(true); else this.setVisible(false); } private void initializeComponent(String str1,String str2,String str3){ jLabel1 = new JLabel(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); jLabel4 = new JLabel(); jTextArea2 = new JTextArea(); jScrollPane3 = new JScrollPane(); jTextArea3 = new JTextArea(); jScrollPane4 = new JScrollPane(); jTextArea4 = new JTextArea(); jScrollPane5 = new JScrollPane(); jTextArea5 = new JTextArea(); jScrollPane6 = new JScrollPane(); jButton1 = new JButton(); jButton2 = new JButton(); jButton3 = new JButton();
73

jButton4 = new JButton(); jButton5 = new JButton(); jButton6 = new JButton(); jButton7 = new JButton(); jButton8 = new JButton(); jButton9 = new JButton(); jButton10 = new JButton(); jButton11 = new JButton(); jButton12 = new JButton(); jButton13 = new JButton(); contentPane = (JPanel)this.getContentPane(); String sender1=""; String sender2=""; String sender3=""; if(!str1.equals("")) { sender1=getsender(str1); new Client("photo"+sender1); jLabel1.setIcon(new ImageIcon("c:/orkut_java/photos/"+sender1+".jpg")); jLabel1.setForeground(new Color(255, 0, 0)); jLabel1.setText("NO PHOTO"); } if(!str2.equals(""))
74

{ sender2=getsender(str2); new Client("photo"+sender2); jLabel2.setIcon(new ImageIcon("c:/orkut_java/photos/"+sender2+".jpg")); jLabel2.setForeground(new Color(255, 0, 0)); jLabel2.setText("NO PHOTO"); } if(!str3.equals("")) { sender3=getsender(str3); new Client("photo"+sender3); jLabel3.setIcon(new ImageIcon("c:/orkut_java/photos/"+sender3+".jpg")); jLabel3.setForeground(new Color(255, 0, 0)); jLabel3.setText("NO PHOTO"); } { jLabel4.setIcon(new ImageIcon("c:/orkut_java/photos/"+name+".jpg")); jLabel4.setForeground(new Color(255, 0, 0)); jLabel4.setText("NO PHOTO"); } jTextArea2.setBackground(new Color(255, 255, 255)); jTextArea3.setEditable(true); jScrollPane3.setViewportView(jTextArea2);
75

jTextArea3.setBackground(new Color(140, 152, 236)); jTextArea3.setText(str1); jTextArea3.setEditable(false); jScrollPane4.setViewportView(jTextArea3); jTextArea4.setBackground(new Color(140, 152, 236)); jTextArea4.setText(str2); jTextArea4.setEditable(false); jScrollPane5.setViewportView(jTextArea4); jTextArea5.setBackground(new Color(140, 152, 236)); jTextArea5.setText(str3); jTextArea5.setEditable(false); jScrollPane6.setViewportView(jTextArea5); jButton1.setText("Submit"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ try { jButton1_actionPerformed(e); } catch(Exception ex) { new serverdown(); }
76

}}); jButton2.setText("Next"); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); }}); if(max==1) { jButton2.setVisible(false); jButton3.setVisible(false); } jButton3.setText("Back"); jButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton3_actionPerformed(e); } }); jButton4.setText("Home"); jButton4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton4_actionPerformed(e); } }); jButton5.setText("Friends");
77

jButton5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ jButton5_actionPerformed(e); }}); jButton6.setText("Refresh"); jButton6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ jButton6_actionPerformed(e); }}); jButton7.setText("Search"); jButton7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ jButton7_actionPerformed(e); }}); if(str1.equals("")) jButton8.setVisible(false); else{ jButton8.setBackground(new Color(140, 152, 236)); jButton8.setText(sender1); jButton8.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton8_actionPerformed(e); }}); }
78

if(str2.equals("")) jButton9.setVisible(false); else { jButton9.setBackground(new Color(140, 152, 236)); jButton9.setText(sender2); jButton9.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton9_actionPerformed(e); }); } if(str3.equals("")) jButton10.setVisible(false); else{ jButton10.setBackground(new Color(140, 152, 236)); jButton10.setText(sender3); jButton10.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton10_actionPerformed(e); } }); } if(str1.equals("") || ! (name.equals(orkut.currentuser) || sender1.equals(orkut.currentuser) )) jButton11.setVisible(false); else{ jButton11.setBackground(new Color(140, 152, 236));
79

jButton11.setText("Delete"); jButton11.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton11_actionPerformed(e); } }); } if(str2.equals("") || ! (name.equals(orkut.currentuser) || sender2.equals(orkut.currentuser) )) jButton12.setVisible(false); else{

jButton12.setBackground(new Color(140, 152, 236)); jButton12.setText("Delete"); jButton12.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton12_actionPerformed(e); }}); } if(str3.equals("") || ! (name.equals(orkut.currentuser) || sender3.equals(orkut.currentuser) )) jButton13.setVisible(false); else{ jButton13.setBackground(new Color(140, 152, 236));
80

jButton13.setText("Delete"); jButton13.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton13_actionPerformed(e); }}); } contentPane.setLayout(null); contentPane.setBackground(new Color(140, 152, 236)); addComponent(contentPane, jLabel1, 22,163,100,100); addComponent(contentPane, jLabel2, 22,327,100,100); addComponent(contentPane, jLabel3, 22,471,100,100); addComponent(contentPane, jLabel4, 22,45,100,100); addComponent(contentPane, jScrollPane3, 184,55,420,87); addComponent(contentPane, jScrollPane4, 150,163,534,120); addComponent(contentPane, jScrollPane5, 150,327,534,120); addComponent(contentPane, jScrollPane6, 150,471,534,120); addComponent(contentPane, jButton1, 631,75,83,40); addComponent(contentPane, jButton2, 583,615,83,37); addComponent(contentPane, jButton3, 494,615,83,37); addComponent(contentPane, jButton4, 22,6,83,37); addComponent(contentPane, jButton5, 108,6,83,37); addComponent(contentPane, jButton6, 194,6,83,37);
81

addComponent(contentPane, jButton7, 280,6,83,37); addComponent(contentPane, jButton8, 1,266,138,30); addComponent(contentPane, jButton9, 1,430,138,30); addComponent(contentPane, jButton10, 1,574,138,30); addComponent(contentPane, jButton11, 695,200,83,35); addComponent(contentPane, jButton12, 695,364,83,35); addComponent(contentPane, jButton13, 695,508,83,35); this.setTitle( "Welcome to "+name+"'s Scrapbook" ); this.setLocation(new Point(0, 0)); this.setSize(new Dimension(1366,768 )); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c); } private void jButton1_actionPerformed(ActionEvent e) { try { String str=jTextArea2.getText(); FileReader fr = new FileReader("c:/orkut_java/temp.txt"); BufferedReader br = new BufferedReader(fr);
82

int maxscrp =Integer.parseInt(br.readLine()); maxscrp++; Date date=new Date() String s="filin"+name+'*'+maxscrp+"\n"+str+"\n\n\n"+date+"\n"+orkut.currentuser+"\n~!@#$%\n" ; new Client(s); fr.close(); br.close(); refresh(); this.setVisible(false); jTextArea2.setText(""); } catch(Exception ex) { new serverdown(); this.setVisible(false); }} private void jButton2_actionPerformed(ActionEvent e) { if((max-1)!=number){ aa[number].setVisible(false); aa[number+1].setVisible(true);

83

}} private void jButton3_actionPerformed(ActionEvent e) { if(number!=0){ aa[number].setVisible(false); aa[number-1].setVisible(true); }} private void jButton4_actionPerformed(ActionEvent e) { new viewprofile(orkut.currentuser); this.setVisible(false); } private void jButton5_actionPerformed(ActionEvent e) { Client c=new Client("frien"+orkut.currentuser); int start=0; int friends=0; int temp1; if(c.strrecv!=null){ int last=c.strrecv.length(); int max; String arr[]=new String[6]; while(start<last){
84

if((temp1=c.strrecv.indexOf("$",start))!=-1) { friends++; start=temp1+1; } start++; } if(friends==0) max=0; else if(friends%6==0) max=friends/6; else max= friends/6+1; friend[] fri =new friend[max]; int frameno=0; int count=0; int cc; int c1; int photo=1; start=0; String temp=null; while(start<last)
85

{ if(count==6) {for(int i=0;i<6;i++) if(arr[i]!=null) { new Client("photo"+arr[i]); photo++; } fri[frameno]=new friend(arr,orkut.currentuser,fri,max-1,frameno++); for(int i=0;i<6;i++) arr[i]=null; count =0; } if((cc=c.strrecv.indexOf("$",start))!=-1) { temp=c.strrecv.substring(start,cc); start=cc+1; if((c1=temp.lastIndexOf("#"))!=-1) temp=temp.substring(c1+1,temp.length()); if((c1=temp.lastIndexOf("*"))!=-1) temp=temp.substring(c1+1,temp.length()); arr[count++] =temp; } else start++;
86

} if(frameno==max-1) { for(int i=0;i<count;i++) if(arr[i]!=null) { new Client("photo"+arr[i]); photo++; } fri[frameno]=new friend(arr,orkut.currentuser,fri ,max-1,frameno++); }} this.setVisible(false); } private void jButton6_actionPerformed(ActionEvent e) { try{ refresh(); this.setVisible(false); } catch(Exception ex) { new serverdown(); }}
87

private void jButton7_actionPerformed(ActionEvent e) { new searchname(); this.setVisible(false); } private void jButton8_actionPerformed(ActionEvent e) { if(!(jButton8.getText()).equals(orkut.currentuser)) new view_others(jButton8.getText()); else new viewprofile(jButton8.getText()); this.setVisible(false); } private void jButton9_actionPerformed(ActionEvent e) { if(!(jButton8.getText()).equals(orkut.currentuser)) new view_others(jButton9.getText()); else new viewprofile(jButton9.getText()); this.setVisible(false); } private void jButton10_actionPerformed(ActionEvent e) {
88

if(!(jButton10.getText()).equals(orkut.currentuser)) new view_others(jButton10.getText()); else new viewprofile(jButton10.getText()); this.setVisible(false); } private void jButton11_actionPerformed(ActionEvent e) { int scrapno=3*number+1; new Client("delet"+name+"*"+scrapno); try{ refresh(); this.setVisible(false); } catch(Exception exs){ new serverdown(); }} private void jButton12_actionPerformed(ActionEvent e) { int scrapno=3*number+2; new Client("delet"+name+"*"+scrapno); try{ refresh(); this.setVisible(false);
89

} catch(Exception exs){ new serverdown(); } private void jButton13_actionPerformed(ActionEvent e) { int scrapno=3*number+3; new Client("delet"+name+"*"+scrapno); try; refresh(); this.setVisible(false); } catch(Exception exs){ new serverdown(); }} void refresh() throws Exception { new Client("scrap"+name); FileReader fr = new FileReader("c:/orkut_java/temp.txt"); BufferedReader br = new BufferedReader(fr); int c=Integer.parseInt(br.readLine()); int j; int maxfrm; if(c==0) maxfrm=1;
90

else if((c%3)==0) maxfrm=c/3; else maxfrm=(c/3)+1; view_scrapbook array[] =new view_scrapbook [maxfrm]; String temp; String src[]=new String[3]; for(int i=0;i<maxfrm;i++) { src[0]=src[1]=src[2]=""; for(j=0;j<3;j++) { if(br.read()==-1) break; temp=br.readLine(); while( !(temp.equals("~!@#$%"))) { src[j]+=temp+"\n"; temp=br.readLine(); }} if( c%3==1 && i==maxfrm-1) src[2]=""; array[i]=new view_scrapbook(src[0],src[1],src[2],array,i,c,name); } br.close();
91

fr.close(); } String getsender(String s) { int i,l; String nm; l=s.length(); for( i=l-2;s.charAt(i)!='\n' && i>=0;i--); nm = s.substring(i+1,l); nm=nm.trim(); return nm; } }

92

Chapter 6
Implementation And Testing
IMPLEMENTATION
The project is implemented using the JAVA programming language. The implementation details of the project are as follows The methods that we have used are as follows: 1. Login 2. Action performed 3. Show message 4. Getsource 5. Getconnection 6. Getruntime 7. Exec

TESTING TESTING METHODS USED The development of software involves a series of production activities where opportunities for injecting of human fallibility are enormous. Because of human inability to perform and communicate with the perfection, software development is accompanied by a quality assurance activity. Performance testing was not taken for consideration as the available hardware is of minimum required configuration. Software Testing Techniques The Test Case design methods used are: 1. WHITE BOX TESTING 2. BLACK BOX TESTING

93

1) WHITE BOX TESTING Using this testing method it was assured that all the independent paths were exercised atlas once. All the logical decisions on their True and False sides were executed. Statement Coverage Criteria was taken into accounts and was ensured that every statement was executed atlas once.

2) BALCK BOX TESTING Using this technique incorrect and missing functions were identified and corrected. Interfacing errors, initialization errors and termination errors were also found using this technique. The errors uncovered during the testing were analyzed and fixed and documented for the future use.

DIFFERENT LEVELS OF TESTING A strategy for the software testing integrates test case design techniques into a well-planned series of steps that results in the successful construction of software. Any testing strategy must incorporate test planning, test execution and resultant data collection and evaluation. Unit testing and integration testing were the performance of the system and the output was a expected and consistent. Unit Testing Unit testing focuses verification efforts on the smallest unit of software design. Each of the modules was verified individually for errors. Integration Testing Integration testing is a systematic technique for constructing the program structure while at same time conducting tests to uncover errors associated with interfacing. Here unittesting modules were taken and the program structure that was specified in the design was built and then testing was carried out.

94

USER INTERFACE TESTING User interface design plays a major part in the success of the project. Keeping in mind the system was developed and ease-of-use aspect was maintained in the design of system. All the modules were tested exhaustively and the encountered errors were rectified. The form design was on par with the existing form design and hence the reduction of strain results. The validation error messages were simple and unambiguous. All internal data structures are assured their validity. Black box testing Black box testing method focuses on functional requirements of the software to enable the software engineer to derive sets of input conditions that will fully exercise all function requirements of a program. Using this technique incorrect and missing functions were identified and corrected. Errors in Data Structures or external database access were also corrected. Interfacing errors, initialization errors and termination errors were also found using this technique. The errors uncovered during the testing were analyzed and fixed and documented for the future use. DIFFERENT LEVELS OF TESTING A strategy for software testing integrates software test case design techniques into a wellplanned series of steps that results in the successful construction of software. Any testing strategy must incorporate test-planning, test case Design, test execution and the resultant data collection and evaluation. Unit testing and integration testing were the performed of the system and the outputs were expected and consistent. a) UNIT TESTING Using testing focuses on verification effort on the smallest unit of software design. The unit test considerations that were taken are: Integrity of local data structures. Interface
95

Boundary conditions Independent paths Error handling paths Unreachable codes

b) INTEGRATION TESTING Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. Here unit tested modules were taken and the program structure that was specified in the design was built and then testing was carried out. The bottom up approach was applied and the stubs were created wherever necessary. User interface design plays a major part in the success of the project. Keeping in mind the system was developed and ease-of-use aspect was maintained in the design forms. All the forms were tested exhaustively and the encountered were rectified. The form design was on par with the existing form design hence reduction in the strain caused. The validation error messages were simple and unambiguous.

96

Chapter 7
SNAPSHOTS
WELCOME PAGE

HOME PAGE

97

FRIENDLIST

SCRAPBOOK

98

EDIT PROFILE

LOGIN FAILED

99

SEARCH

100

Chapter 8
Constraints
Our group project of Orkut is a mini project, so we havent included all the features that are present in the real Orkut , which most of the people use these days on the internet. We have included only basic features that help the users to communicate with each other (for chatting purpose).Some of the constraints are listed below. 1.Time constraint 2.Restricted access 3.Inability to run on the internet. 4.Other Limitations (space and size.) 5.Choosing the appropriate GUI. The above mentioned constraints are explained below. The major constraint was the time constraint. As we had to complete the project within one and half month the time available was less for us to include all the features in our project. We had to cope up with other projects ,mid exams and assignments ,along with this project. Therefore we decided to include only necessary features like maintaining scrapbook, image display, uploading photos from computer, friends, add as friend and searching for friends options. Our project works on LAN so its available only to few people having a connection to their local network .The communicating parties should have the necessary software and hardware installed if they are interested to use it.As our project is done using Java language, the interested users should have proper version of JDK installed which may not be feasible for all the users. We cant put this module on the internet as this is not a website and its not done using HTML(its done using java programming language and applets are not used by us).Also putting anything on the internet requires legacy and license agreements(and lot of money).On the other hand the real orkut is more widely used as anybody having an internet connection can use it effectively. No particular hardware or software requirements are required for that

101

,apart from a PC with internet connection. People leaving in any part of the world can communicate with each other if they have an orkut account, whereas our orkut is localized. The group orkut has many features like communities, fans, add to crush list, emoticons, photo album, write testimonial etc. We havent included these features because the code would become too large and difficult to understand. As we used all the concepts of Java viz. file handling , multithreading, interfaces, string handling, Graphic User Interface, multimedia for images, JDBC to connect to database in MS Access, socket programming for networking where server application is run on one machine and clients on other machine, including all the features in our project Would have been difficult to handle and it would also require lot of disk space. Even though we have included only basic requirements our code is roughly about three thousand lines (more than 250kb of only JAVA source files !!!!) because here extensive GUI is required where on the click of every button, a new frame opens. The code of each frame is itself quite big as there are many buttons , text fields, text areas, space for displaying image, radio buttons and scroll panes in some of the frames, action listener for each button and Java class library. Hence if the code becomes too large then it would take a lot of time to compile and execute. The server process would become slow and networking could be difficult. The features like writing testimonials, fan list crush list, bookmarks could not be added for the above reasons and also they are all special features which can be added later on as an when required according to the user. Another important factor was to decide between the use of applets and frames for the GUI part of this project. We decided to use frames because of the simplicity of working of frames(i.e. one frame calling one another is better than all operations done in applet itself) .Moreover as our orkut was not meant for internet since it works on LAN, we did not find the use of applets necessary. These were some of the constraints we came through while developing our project. Few remedies and the future aspects are discussed in the next topic.

102

Chapter 9
Future Aspect
In the earlier topic we discussed the constraints concerning our project, lets move further and discuss the future aspects of our project. First let us find some remedy (solutions) to our earlier defined constraints. 1. Time factor: As discussed earlier ,considering the time given to us for completion of our project was much less than required ,we were unable to rope in most of the attractive (but not so important) functions in our project orkut .Latter if we get time then we will surely add some of the following functions provided by real orkut. Communities: This feature will enable the user to join the group he want to be part of .for eg :if a particular user is fan of saurav ganguly ,then he can join(or start ) a community called as saurav ganguly fan club(wonder anyone will join it !!!!) also any user can start any community of his choice. The community can be moderated one or open to all as in real orkut. Write testimonials: Through this feature any user can write sweet memories or any thing he can think of for his friends in testimonials. (This can be also written in scraps but its just for feel-good factor.) Fans: If a user is completely bowled over his friends personality, then he can be his fan.(This is another feel-good factor) Album: The user, if he feels so, can maintain an album containing photos of his choice. But there will be maximum limit of photos to be kept in album. These photos can be viewed by all the users of our project orkut. 2. Restricted access: As our project is based on LAN only those computers which are connected by common servers can run our project orkut(for eg:if we access our project orkut from our VN lab, then we wont be able to chat from PCs from mech. Department as there is no common server connecting them ).this constraint cant be removed unless some hardware changes are made to connect two PCs together.

103

3.

Accessing on internet: This constraint can be removed by money only. For running orkut on internet we have to take a website on lease. ( else we can collaborate with yahoo for giving a tough competition to real orkut ,which is handled by google!!)

4.

Other limitations: Initially the number of users on orkut are less, hence the maintenance of database is not a difficult task. But as number of users will increase storage in database would pose a big problem. Hence a system containing all the database information need to be installed .Also a back-up of this system should be taken, in case our original one fails.

5.

Appropriate GUI: We have seen in constraints that why we went with frames instead of applets. We can also design our project with help of applets. Applets provide a very sleek and good-to-look form to our interface. Also if we plan to put our project on internet then Applets will be a preferred choice as they are HTML files only.

104

Chapter 10
Bibliography & References
Here is some of the references used by us for our project. Korth,Database systems,2003,Fourth Edition Tata Macgraw hillsPublishers. Herbert Shieldt,Java Complete Reference,Fifth Edition,Macgraw hills publishers. Joel Murrach,Murachs Beginning Java 2 JDK,2002,Pearson educations publications. Herbert Shieldt,JDBC,Fourth Edition,Macgraw Hill publications.

105

You might also like