Thursday, 11 February 2016

RDBMS Lab@Home 3

1. Display the details of those stores that have Bike in their name. (Use the AdventureWorks database)

Ans.

2.Display all territories whose names begin with 'N'. (Use the AdventureWorks database)


Ans .

3.Display the top three sales persons based on the bonus. (Use the AdventureWorks database)

Ans. 

4.Display the SalesPerson ID, the Territory ID, and the Sales Quota for those sales persons who have been assigned a sales quota. The data should be displayed in the following format. (Use the AdventureWorks database)

Ans 

5. Display a report that contains the employee ID, login ID, and the title of employees. The report should display the records for 10 employees after excluding the records of the first five employees. (Use the AdventureWorks database).



6. Display the different types of credit cards used for purchasing products. (Use the AdventureWorks database)

Ans. 
7. New Heights is a training institute that provides courses on various nontechnical subjects, such as personality improvement and foreign languages. Xuan, the Database Designer, has made the following relations to represent the data about students, batches, and modules covered in the batches: STUD-ID: Student's id (unique) 
 NAME: Name of student 
BATCH-NO: Batch number (one student can belong to only one batch) 
 SLOT: Time and day when the batch of students attends the class 
 MODULE: Module or subject (one batch will do several modules)
 MARKS: Marks obtained in a module test Xuan now needs to simplify the above relations by normalizing them.


8. Consider the following 

Student table. The preceding table is in the first normal form. How can this table be converted into the second normal form?


9. Consider the following 

Product table. The preceding table is not normalized. How can this table be converted into the first normal form?


10. Consider the following Purchase_Details table. 

Cust_ID and StoreID make the composite primary key in the table. Identify the partial dependency in the table, if any. How can you remove the partial dependency to attain the next normal form?

Sunday, 7 February 2016

RDBMS Lab@Home 2

Q.1. Display the ID, type, number, and expiry year of all the credit cards in the following format. (Use the AdventureWorks database)





Ans  https://drive.google.com/open?id=0B08RKBSts8D8UGFrMVkxQmZhMTA


Q.2.  Display the details of all the customers. (Use the AdventureWorks database)


Ans. https://drive.google.com/open?id=0B08RKBSts8D8ajlSU1B3clVicUU


Q.3.  Display all the details of the sales orders that have a cost exceeding $ 2,000. (Use the AdventureWorks database)


Ans.  https://drive.google.com/open?id=0B08RKBSts8D8SFRnUjB5eDhQMnc


Q.4.  Display the customer ID and the account number of all the customers who live in the TerritoryID 4. (Use the AdventureWorks database)


Ans.  https://drive.google.com/open?id=0B08RKBSts8D8SDg4OE8yVExRbTg


Q.5.  Display the list of all the orders placed on June 06, 2004. (Use the AdventureWorks database)


Ans   https://drive.google.com/open?id=0B08RKBSts8D8QWxGSnBZbko5ZTQ


Q. 6  Display the sales order details of the product named 'Cable Lock' for which the ProductId is 843. (Use the AdventureWorks database)

Ans   https://drive.google.com/open?id=0B08RKBSts8D8a0VkclEwRUpzc0k


Q.7.  Display the name, country region code, and sales year to date for the territory with Territory ID as 1. (Use the AdventureWorks database)


Ans  https://drive.google.com/open?id=0B08RKBSts8D8YWpnMWJLOFh1eUU


Q.8. Display a list of all the sales orders in the price range of $ 2,000 to $ 2,100. (Use the AdventureWorks database)


Ans   https://drive.google.com/open?id=0B08RKBSts8D8RngtTzlHbTd4VU0


Q.9.   Display the sales territory details of Canada, France, and Germany. (Use the AdventureWorks database)


Ans   https://drive.google.com/open?id=0B08RKBSts8D8WTVROWQxZ2M4Ymc


Q.10.   Display the details of the orders that have a tax amount of more than $ 10,000. (Use the AdventureWorks database)


Ans    https://drive.google.com/open?id=0B08RKBSts8D8akdpSDVTaDhIOGM


Q.11.  Generate a report that contains the IDs of sales persons living in the territory with TerritoryID as 2 or 4. The report is required in the following format. (Use the AdventureWorks database)


Q.12.  Display the details of the Vista credit cards that are expiring in the year 2006. (Use the AdventureWorks database)




Q.13.   Display the orders placed on July 01, 2001 that have a total cost of more than $ 10,000 in the following format. (Use the AdventureWorks database)



Q.14.  Display the details of all the orders that were shipped after July 12, 2004. (Use the AdventureWorks database)




Q.15.  Display a report of all the orders in the following format. (Use the AdventureWorks database)



Q.16.  Display the order ID and the tax amount for the sales orders that are less than $ 2,000. The data should be displayed in ascending order. (Use the AdventureWorks database)



Q.17.  Display the order ID and the total amount due of all the sales orders in the following format. Ensure that the order with the highest price is at the top of the list. (Use the AdventureWorks database)



Q. 18.  Display the order number and the total value of the order in ascending order of the total value. (Use the AdventureWorks database)




Q.19..  Display the details of all the currencies that have the word 'Dollar' in their name. (Use the AdventureWorks database)





Wednesday, 3 February 2016

RDBMS Lab @ Home 1

1. Shopping Spree is a leading departmental store in Shanghai. The store has a number of regular customers who purchase bulk items. The store also conducts regular feedback sessions to analyze customer satisfaction levels. Chen, the Customer Analyst of Shopping Spree, has to make the ER diagram to represent the preceding situation, and then to map the ER diagram to the corresponding tables. Help Chen to do the same.

Ans









2. Design an ER diagram for the following situation:
An organization has two types of employees, salaried and wage earning. Both the types of employees have some common properties, such as employee code, employee name, and employee address. However, the salaried employees have other additional properties: basic, allowance, and House Rent Allowance (HRA). The wage earning employees have distinct properties that are daily wage and overtime.

Ans


3.  Consider the following Doctor-details table.

 In the preceding table, you have to identify primary key, candidate key, and alternate key and give the reason.


Ans 
4.  You have been hired by a regional hospital to create a database that will be used to store the information of the patients. Implementing the database will make the data easily accessible. The following ER diagram represents the relationship between the patient and the doctor. 

In the preceding diagram, you have to identify the entities, their attributes, and the type of relationship between the entities.


Ans  

5. Tom is working in an organization as a database administrator. Based on the hierarchy, the organization has multiple departments and each department has multiple employees. The following ER diagram represents the relationship between the departments and the employees.

 In the preceding diagram, you have to identify entities, their attributes, and type of relationship between the entities.

Ans 

6. Lee Wong is the newly appointed database administrator at Standard bank. The management of this bank wants to computerize the process of banking. According to the bank's policy, one customer can have many accounts but one account cannot be shared by many customers. The following ER diagram represents the relationship between a customer and the accounts owned by a particular customer. 

In the preceding diagram, you have to identify entities, their attributes, and type of relationship between the entities.


Ans. 
7.  Consider the following scenario: 
An author can write multiple books and a book can be written by more than one author. Identify the relationship between the author entity and the book entity and represent it with an ER Diagram.

Ans  


8.  Consider the following scenario: 
In a college, there are multiple departments. Each department has various faculty members. Only one of these faculty members holds the position of the Head of the Department. Identify the relationship between the faculty and the department and represent it with an ER Diagram.


Ans  

Saturday, 30 January 2016

Java _Network Files

Programmers Files  :-

1. SimpleClient

Ans

public class TestThread {
  public static void main(String args[]) {
    Xyz r = new Xyz();
    Thread t = new Thread(r);
    t.start();
  }
}

class Xyz implements Runnable {
  int i;

  public void run() {
    i = 0;

    while (true) {
      System.out.println("Hello " + i++);
      if ( i == 50 ) {
break;
      }
    }
  }
}

  
2.  SimpleServer

Ans

import java.net.*;
import java.io.*;

public class SimpleServer {
  public static void main(String args[]) {
    ServerSocket s = null;

    // Register your service on port 5432
    try {
      s = new ServerSocket(5432);
    } catch (IOException e) {
      e.printStackTrace();
    }

   // Run the listen/accept loop forever
    while (true) {
      try {
        // Wait here and listen for a connection
        Socket s1 = s.accept();
System.out.println("Connection accepted: port=" + s1.getPort());

        // Get output stream associated with the socket
        OutputStream s1out = s1.getOutputStream();
        BufferedWriter bw = new BufferedWriter(
          new OutputStreamWriter(s1out));

        // Send your string!
        bw.write("Hello Net World!\n");

        // Close the connection, but not the server socket
        bw.close();
        s1.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
}


Java _ threads Files

Programmers Files :-


1. Sync File :-https://drive.google.com/open?id=0B08RKBSts8D8aFB2cVVlVFIzTlk




*1 .ControlledThread

Ans

public class ControlledThread extends Thread {
  static final int SUSP = 1;
  static final int STOP = 2;
  static final int RUN = 0;
  private int state = RUN;

  public synchronized void setState(int s) {
    state = s;
    if ( s == RUN ) {
      notify();
    }
  }

  public synchronized boolean checkState() {
    while ( state == SUSP ) {
      try {
        wait();
      } catch (InterruptedException e) {
        // ignore
      }
    }
    if ( state == STOP ) {
      return false;
    }
    return true;
  }

  public void run() {
    while ( true ) {
      //doSomething();

      // Be sure shared data is in consistent state in
      // case the thread is waited or marked for exiting
      // from run()
      if ( !checkState() ) {
        break;
      }
    }
  }
}


*2.  MyStack

Ans

public class MyStack {
  int idx = 0;
  char [] data = new char[6];

  public void push(char c) {
    data[idx] = c;
    idx++;
  }

  public char pop() {
    idx--;
    return data[idx];
  }
}


*3. TestMyStack

Ans

public class TestMyStack {
   public static void main(String args[]) {
     MyStack stack = new MyStack();
     stack.push('H');
     stack.push('i');
     System.out.println("Stack is: " + String.copyValueOf(stack.data));

     stack.pop();
     stack.push('o');
     System.out.println("After one pop and another push, Stack is: " + 
String.copyValueOf(stack.data));
   }
}
     

*4. TestThread

Ans

public class TestThread {
  public static void main(String args[]) {
    Xyz r = new Xyz();
    Thread t = new Thread(r);
    t.start();
  }
}

class Xyz implements Runnable {
  int i;

  public void run() {
    i = 0;

    while (true) {
      System.out.println("Hello " + i++);
      if ( i == 50 ) {
break;
      }
    }
  }
}


Code Files :- https://drive.google.com/open?id=0B08RKBSts8D8LVZyY3hsU25XZUE

Java _guiapps Files

Programmers Files :-

1. SampleMenu

Ans

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SampleMenu
    implements ActionListener, ItemListener {
  private JFrame f;
  private JMenuBar mb;
  private JMenu m1;
  private JMenu m2;
  private JMenu m3;
  private JMenuItem mi1;
  private JMenuItem mi2;
  private JMenuItem mi3;
  private JMenuItem mi4;
  private JCheckBoxMenuItem mi5;

  public void go() {
    f = new JFrame("Menu");
    mb = new JMenuBar();
    m1 = new JMenu("File");
    m2 = new JMenu("Edit");
    m3 = new JMenu("Help");
    mb.add(m1);
    mb.add(m2);
    mb.add(m3);
    f.setJMenuBar(mb);

    mi1 = new JMenuItem("New");
    mi2 = new JMenuItem("Save");
    mi3 = new JMenuItem("Load");
    mi4 = new JMenuItem("Quit");
    mi1.addActionListener(this);
    mi2.addActionListener(this);
    mi3.addActionListener(this);
    mi4.addActionListener(this);
    m1.add(mi1);
    m1.add(mi2);
    m1.add(mi3);
    m1.addSeparator();
    m1.add(mi4);

    mi5 = new JCheckBoxMenuItem("Persistent");
    mi5.addItemListener(this);
    m1.add(mi5);

    f.setSize(200,200);
    f.setVisible(true);
  }

  public void actionPerformed( ActionEvent ae) {
    System.out.println("Button \"" +
        ae.getActionCommand() + "\" pressed.");

    if (ae.getActionCommand().equals("Quit")) {
      System.exit(0);
    }
  }

  public void itemStateChanged(ItemEvent ie) {
    String state = "deselected";

    if (ie.getStateChange() == ItemEvent.SELECTED) {
      state = "selected";
    }
    System.out.println(ie.getItem() + " " + state);
  }

  public static void main (String args[]) {
    SampleMenu sampleMenu = new SampleMenu();
    sampleMenu.go();
  }
}

2. SampleMenu1

Ans

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SampleMenu1 {
  private JFrame f;
  private JMenuBar mb;

  public void go() {
    f = new JFrame("MenuBar");
    mb = new JMenuBar();
    f.setJMenuBar(mb);

    f.setSize(200,200);
    f.setVisible(true);
  }

  public static void main (String args[]) {
    SampleMenu1 sampleMenu = new SampleMenu1();
    sampleMenu.go();
  }
}


3.  SampleMenu2

Ans

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SampleMenu2 {
  private JFrame f;
  private JMenuBar mb;
  private JMenu m1;
  private JMenu m2;
  private JMenu m3;

  public void go() {
    f = new JFrame("Menu");
    mb = new JMenuBar();
    m1 = new JMenu("File");
    m2 = new JMenu("Edit");
    m3 = new JMenu("Help");
    mb.add(m1);
    mb.add(m2);
    mb.add(m3);
    f.setJMenuBar(mb);

    f.setSize(200,200);
    f.setVisible(true);
  }

  public static void main (String args[]) {
    SampleMenu2 sampleMenu = new SampleMenu2();
    sampleMenu.go();
  }
}


4. SampleMenu3

Ans

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SampleMenu3
    implements ActionListener, ItemListener {
  private JFrame f;
  private JMenuBar mb;
  private JMenu m1;
  private JMenu m2;
  private JMenu m3;
  private JMenuItem mi1;
  private JMenuItem mi2;
  private JMenuItem mi3;
  private JMenuItem mi4;

  public void go() {
    f = new JFrame("MenuItem");
    mb = new JMenuBar();
    m1 = new JMenu("File");
    m2 = new JMenu("Edit");
    m3 = new JMenu("Help");
    mb.add(m1);
    mb.add(m2);
    mb.add(m3);
    f.setJMenuBar(mb);

    mi1 = new JMenuItem("New");
    mi2 = new JMenuItem("Save");
    mi3 = new JMenuItem("Load");
    mi4 = new JMenuItem("Quit");
    mi1.addActionListener(this);
    mi2.addActionListener(this);
    mi3.addActionListener(this);
    mi4.addActionListener(this);
    m1.add(mi1);
    m1.add(mi2);
    m1.add(mi3);
    m1.addSeparator();
    m1.add(mi4);

    f.setSize(200,200);
    f.setVisible(true);
  }

  public void actionPerformed( ActionEvent ae) {
    System.out.println("Button \"" + 
        ae.getActionCommand() + "\" pressed.");

    if (ae.getActionCommand().equals("Quit")) {
      System.exit(0);
    }
  }

  public void itemStateChanged(ItemEvent ie) {
    String state = "deselected";

    if (ie.getStateChange() == ItemEvent.SELECTED) {
      state = "selected";
    }
    System.out.println(ie.getItem() + " " + state);
  }

  public static void main (String args[]) {
    SampleMenu3 sampleMenu = new SampleMenu3();
    sampleMenu.go();
  }
}


5. SampleMenu4

Ans

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SampleMenu4
    implements ActionListener, ItemListener {
  private JFrame f;
  private JMenuBar mb;
  private JMenu m1;
  private JMenu m2;
  private JMenu m3;
  private JMenuItem mi1;
  private JMenuItem mi2;
  private JMenuItem mi3;
  private JMenuItem mi4;
  private JCheckBoxMenuItem mi5;

  public void go() {
    f = new JFrame("CheckboxMenuItem");
    mb = new JMenuBar();
    m1 = new JMenu("File");
    m2 = new JMenu("Edit");
    m3 = new JMenu("Help");
    mb.add(m1);
    mb.add(m2);
    mb.add(m3);
    f.setJMenuBar(mb);

    mi1 = new JMenuItem("New");
    mi2 = new JMenuItem("Save");
    mi3 = new JMenuItem("Load");
    mi4 = new JMenuItem("Quit");
    mi1.addActionListener(this);
    mi2.addActionListener(this);
    mi3.addActionListener(this);
    mi4.addActionListener(this);
    m1.add(mi1);
    m1.add(mi2);
    m1.add(mi3);
    m1.addSeparator();
    m1.add(mi4);

    mi5 = new JCheckBoxMenuItem("Persistent");
    mi5.addItemListener(this);
    m1.add(mi5);

    f.setSize(200,200);
    f.setVisible(true);
  }

  public void actionPerformed( ActionEvent ae) {
    System.out.println("Button \"" + 
        ae.getActionCommand() + "\" pressed.");

    if (ae.getActionCommand().equals("Quit")) {
      System.exit(0);
    }
  }

  public void itemStateChanged(ItemEvent ie) {
    String state = "deselected";

    if (ie.getStateChange() == ItemEvent.SELECTED) {
      state = "selected";
    }
    System.out.println(ie.getItem() + " " + state);
  }

  public static void main (String args[]) {
    SampleMenu4 sampleMenu = new SampleMenu4();
    sampleMenu.go();
  }
}


6.  TestColor

Ans

import java.awt.*;
public class TestColor {
  public static void main(String[] args) {
    TestColor tester = new TestColor();
    tester.launchFrame();
  }
  TestColor() {}
  private void launchFrame() {
    Frame f = new Frame();
    Button b = new Button("Purple");
    Color purple = new Color(255, 0, 255);
    b.setBackground(purple);
    f.add(b);
    f.pack();
    f.setVisible(true);
  }
}


7. TestPrinting

Ans


import java.awt.*;
import java.awt.event.*;

public class TestPrinting {

  private Frame frame;
  private TextArea output;
  private TextField input;

  public TestPrinting() {
    frame = new Frame("Chat Room");
    output = new TextArea(10,50);
    input = new TextField(50);
  }

  public void launchFrame() {
    Button button;

    frame.setLayout(new BorderLayout());

    frame.add(output,BorderLayout.WEST);
    frame.add(input,BorderLayout.SOUTH);

    Panel p1 = new Panel(); 

    // Add Send button
    button = new Button("Send");
    button.addActionListener(new SendHandler());
    p1.add(button);

    // Add Print button
    button = new Button("Print");
    button.addActionListener(new PrintHandler());
    p1.add(button);

    // Add Quit button
    button = new Button("Quit");
    // Use an anonymous inner class for variety.
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
System.exit(0);
      }
    });
    p1.add(button);

    frame.add(p1,BorderLayout.CENTER);

    // Attach listener to the appropriate components
    frame.addWindowListener(new CloseHandler());
    input.addActionListener(new InputHandler());

    frame.setSize(440,210);
    frame.setVisible(true);
  }

  private void copyText() {
    String text = input.getText();
    output.setText(output.getText()+text+"\n");
    input.setText("");
  }

  private class SendHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      copyText();
    }
  }

  private class PrintHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      Toolkit toolkit = frame.getToolkit();
      PrintJob job = toolkit.getPrintJob(frame, "Print the Chat Room", null);
      Graphics g = job.getGraphics();

      frame.print(g);
      g.dispose();
      job.end();
    }
  }

  private class CloseHandler extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
      System.exit(0);
    }
  }
    
  private class InputHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      copyText(); 
    }
  }

  public static void main(String[] args) {
    TestPrinting c = new TestPrinting();
    c.launchFrame();
  }
}


Java _events Files

Programmers file 

1. ButtonHandler

Ans

import java.awt.event.*;

public class ButtonHandler implements ActionListener {
  public void actionPerformed(ActionEvent e) {
    System.out.println("Action occurred");
    System.out.println("Button's command is: "
                       + e.getActionCommand());
  }

}

2.  MouseClickHandler

Ans

import java.awt.*;
import java.awt.event.*;

public class MouseClickHandler extends MouseAdapter {

// We just need the mouseClick handler, so we use
// the Adapter to avoid having to write all the
// event handler methods

public void mouseClicked (MouseEvent e) {
// Do stuff with the mouse click...
}

}

3. TestAnonymous

Ans

import java.awt.*;
import java.awt.event.*;

public class TestAnonymous {
  private Frame f;
  private TextField tf;

  public TestAnonymous() {
    f = new Frame("Anonymous classes example");
    tf = new TextField(30);
  }

  public void launchFrame() {
    Label label = new Label("Click and drag the mouse");
    // Add components to the frame
    f.add(label, BorderLayout.NORTH);
    f.add(tf, BorderLayout.SOUTH);
    // Add a listener that uses an anonymous class
    f.addMouseMotionListener( new MouseMotionAdapter() {
      public void mouseDragged(MouseEvent e) {
        String s = "Mouse dragging:  X = "+ e.getX()
                    + " Y = " + e.getY();
        tf.setText(s);
      }
    }); // <- note the closing parenthesis
    f.addMouseListener(new MouseClickHandler());
    // Size the frame and make it visible
    f.setSize(300, 200);
    f.setVisible(true);
  }

  public static void main(String args[]) {
    TestAnonymous obj = new TestAnonymous();
    obj.launchFrame();
  }
}

4. TestButton

Ans

import java.awt.*;

public class TestButton {
  private Frame f;
  private Button b;

  public TestButton() {
    f = new Frame("Test");
    b = new Button("Press Me!");
    b.setActionCommand("ButtonPressed");
  }

  public void launchFrame() {
    b.addActionListener(new ButtonHandler());
    f.add(b,BorderLayout.CENTER);
    f.pack();
    f.setVisible(true);
  }

  public static void main(String args[]) {
    TestButton guiApp = new TestButton();
    guiApp.launchFrame();
  }
}


5.  TestInner

Ans

import java.awt.*;
import java.awt.event.*;

public class TestInner {
  private Frame f;
  private TextField tf;

  public TestInner() {
    f = new Frame("Inner classes example");
    tf = new TextField(30);
  }

  public void launchFrame() {
    Label label = new Label("Click and drag the mouse");
    // Add components to the frame
    f.add(label, BorderLayout.NORTH);
    f.add(tf, BorderLayout.SOUTH);
    // Add a listener that uses an Inner class
    f.addMouseMotionListener(this.new MyMouseMotionListener());
    f.addMouseListener(new MouseClickHandler());
    // Size the frame and make it visible
    f.setSize(300, 200);
    f.setVisible(true);
  }

  class MyMouseMotionListener extends MouseMotionAdapter {
      public void mouseDragged(MouseEvent e) {
        String s = "Mouse dragging:  X = "+ e.getX()
                    + " Y = " + e.getY();
        tf.setText(s);
      }
    }

  public static void main(String args[]) {
    TestInner obj = new TestInner();
    obj.launchFrame();
  }
}


6. TwoListener

Ans

import java.awt.*;
import java.awt.event.*;

public class TwoListener
     implements MouseMotionListener, 
                MouseListener {
  private Frame f;
  private TextField tf;

  public TwoListener() {
    f = new Frame("Two listeners example");
    tf = new TextField(30);
  }

  public void launchFrame() {
    Label label = new Label("Click and drag the mouse");
    // Add components to the frame
    f.add(label, BorderLayout.NORTH);
    f.add(tf, BorderLayout.SOUTH);
    // Add this object as a listener
    f.addMouseMotionListener(this);
    f.addMouseListener(this);
    // Size the frame and make it visible
    f.setSize(300, 200);
    f.setVisible(true);
  }

  // These are MouseMotionListener events
  public void mouseDragged(MouseEvent e) {
    String s =  "Mouse dragging:  X = " + e.getX()
                + " Y = " + e.getY();
    tf.setText(s);
  }

  public void mouseEntered(MouseEvent e) {
    String s = "The mouse entered";
    tf.setText(s);
  }

  public void mouseExited(MouseEvent e) {
    String s = "The mouse has left the building";
    tf.setText(s);
  }

  // Unused MouseMotionListener method.
  // All methods of a listener must be present in the
  // class even if they are not used.
  public void mouseMoved(MouseEvent e) { }

  // Unused MouseListener methods.
  public void mousePressed(MouseEvent e) { }
  public void mouseClicked(MouseEvent e) { }
  public void mouseReleased(MouseEvent e) { }

  public static void main(String args[]) {
    TwoListener two = new TwoListener();
    two.launchFrame();
  }
}