ServerFrame(String professorName,String departmentName,String subjectName,String topicName) throws IOException
	{
		super("Class Room Interaction");
		
		/*
		File image2=new File("Images/mic_icon.png");
		System.out.println("hello lavish kothari");
		try {
			Image image = ImageIO.read(image2);
			this.setIconImages((List<? extends Image>) image);
		} catch (IOException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		*/
		final List<Image> icons = new ArrayList<Image>();
		icons.add(ImageIO.read(new File("Images/mic_logo.png")));
		this.setIconImages(icons);
        
		/**************************/
		/*
		 *  set the look and feel to reflect the platform
		 */
		
		try { 
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
		    e.printStackTrace();
		}
		
		/*************************/
		ServerFrame.professorName=professorName;
		ServerFrame.departmentName=departmentName;
		ServerFrame.subjectName=subjectName;
		ServerFrame.topicName=topicName;
		
		WelcomeDialog welcomeDialog=new WelcomeDialog(this,professorName,departmentName,subjectName,topicName);
		welcomeDialog.setVisible(true);
		/*******************************************/
		
		/****************************************/

    	filenameInServerFrame= "Images/print.txt";
        FileWriter fw;
	    try 
	    {
	    	int i=0;
                fileNo=i;
	    	while(new File(filenameInServerFrame).exists())
		    {
	    		i++;
                        fileNo=i;
	    		filenameInServerFrame="Images/print"+(i)+".txt";
		    }
	    	fileNumber=i;
		    fw = new FileWriter(filenameInServerFrame,false);
		    fw.write("Professor's Name : "+WelcomeDialog.professorsName+"\n");
		    fw.write("Department : "+WelcomeDialog.departmentName+"\n");
		    fw.write("Subject : "+WelcomeDialog.subjectName+"\n");
		    fw.write("Topic : "+WelcomeDialog.topicName+"\n"+"\n"+"\n");
		    
		   fw.close();
	    } 
	    catch (IOException e1) {
	    	// TODO Auto-generated catch block
	    	e1.printStackTrace();
	    } //the true will append the new data
	       
	    /******************************************/
		currentObject=this;
		/* initializeGraphicComponents();
		 * 
		 * this method will initialize all the graphic components displayed
		 * on the screen and ensuring that no NullPointerException is generated
		 */
		initializeGraphicComponents();

		audioPanel.add(new JScrollPane(studentPanel),BorderLayout.CENTER);
		audioPanel.setBackground(Color.white);
		studentMsg.setVisible(false);
		studentMsg=new JPanel();
		studentMsg.setLayout(new GridLayout(5,1,10,5));
	
		for(int i=0;i<Integer.parseInt(studentNumberComboBox.getSelectedItem().toString()) && i<Student.studentListText.size();i++)
		{
			studentMsg.add(createStudentTextMsgPanel(i,Student.studentListText.get(i)));
		}
		
		textPanel.add(studentMsg,BorderLayout.CENTER);
		
		///////////////////////////////////////
		/*
		 * the following function is used to maximize the ServerFrame
		 */
		this.setExtendedState(this.getExtendedState()|JFrame.MAXIMIZED_BOTH );
		setLocation(0,0); // setting the location of the frame
		
		ipPanel=new JPanel(); // ip panel will contain the ip address and the auto-generated sessionID.
		
		topPanel=new JPanel(); // top panel will containg the ipPanel and the app's Name.
		topPanel.setBackground(new Color(255,255,255));
		
		topPanel.setLayout(new BorderLayout(30,30));
		
		//topPanel.setBorder(new MatteBorder(0,0,1,0,new Color(240,240,240)));
		ipPanel.setLayout(new GridLayout(2,1,10,10));
		
		/*
		 * adding different components to the ipPanel
		*/
		ipPanel.add(ipLabel);
		ipPanel.add(sessionIdLabel);
		
		/*
		 * there are two tabbedPanes in the center of the screen
		 * each pane is a Panel 
		 * there are two panels added to the JTabbedPane
		 * first one is the audio Panel
		 * and the second one is the texxt Panel
		 */
		
		/* this is the method for creating the audio panel*/
		createAudioPanel();
		
		/* this is the method for creating the text panel */
		createTextPanel();
		
		
		JLabel listLabel=new JLabel("View :");
		listLabel.setFont(new Font("lucida console",Font.PLAIN,20));
		JPanel bottomPanel=new JPanel();
		bottomPanel.setLayout(new BorderLayout(10,10));
		
		/*
		 * now here you have to create  a button that will show the status of waiting list.
		 */
		
		//waitingButton = new JButton("Waiting : "+studentNumberComboBox.getSelectedItem().toString());
		waitingButton = new JButton("Waiting : 0");

		JPanel viewPanel=new JPanel();
		viewPanel.setLayout(new FlowLayout());
		viewPanel.setBackground(new Color(255,255,255));
		viewPanel.add(listLabel);
		viewPanel.add(studentNumberComboBox);
		bottomPanel.add(viewPanel,BorderLayout.WEST);
		//bottomPanel.add(studentNumberComboBox,BorderLayout.CENTER);
		
		//bottomPanel.add(waitingButton,BorderLayout.EAST);
		bottomPanel.add(searchField,BorderLayout.EAST);
		
		textPanel=new JPanel();
		textPanel.setBackground(Color.WHITE);
		textPanel.setLayout(new BorderLayout(10,10));
		tabbedPane=new JTabbedPane();
		ImageIcon icon1=new ImageIcon("Images/audio2.png");
		ImageIcon icon2=new ImageIcon("Images/doubt_text.png");
		
		tabbedPane.addTab("<html><body leftmargin=15 topmargin=0 marginwidth="+(int)(this.width*0.2152)+" marginheight=0><h2>Audio<h2></body></html>",audioPanel);
		tabbedPane.addTab("<html><body leftmargin=15 topmargin=0 marginwidth="+(int)(this.width*0.2152)+" marginheight=0><h2>Text</h2></body></html>",textPanel);
		
		/***********************************************/
		detailsPanel.setLayout(new BorderLayout(10,10));
		/*
		JPanel subDetailsPanel=new JPanel();
		subDetailsPanel.setLayout(new GridLayout(2,2,5,5));
		*/
		/*
		 * creating labels
		 */
		JLabel departmentLabel=new JLabel("@ "+WelcomeDialog.departmentName);
		departmentLabel.setFont(new Font("lucida console",Font.PLAIN,20));
		departmentLabel.setForeground(new Color(200,200,200));
		
		JLabel professorNameLabel=new JLabel(WelcomeDialog.professorsName);
		professorNameLabel.setFont(new Font("lucida console",Font.PLAIN,30));
		professorNameLabel.setForeground(new Color(100,100,100));
		
		JLabel subjectNameLabel=new JLabel(" "+WelcomeDialog.subjectName);
		subjectNameLabel.setFont(new Font("lucida console",Font.PLAIN,45));
		subjectNameLabel.setForeground(new Color(150,150,150));
		subjectNameLabel.setBorder(new MatteBorder(0, 3, 0, 0, new Color(200,200,200)));
		
		
		JLabel topicNameLabel=new JLabel(WelcomeDialog.topicName);
		topicNameLabel.setFont(new Font("lucida console",Font.BOLD,45));
		
		/*
		subDetailsPanel.add(subjectNameLabel);
		subDetailsPanel.add(topicNameLabel);
		subDetailsPanel.add(professorNameLabel);
		subDetailsPanel.add(new JLabel(""));
		
		detailsPanel.add(subDetailsPanel,BorderLayout.CENTER);
		detailsPanel.add(departmentLabel,BorderLayout.NORTH);
		*/
		
		JPanel topDetailsPanel=new JPanel();
		topDetailsPanel.setLayout(new BorderLayout(10,10));
		JPanel bottomDetailsPanel=new JPanel();
		bottomDetailsPanel.setLayout(new BorderLayout(10,10));
		
		topDetailsPanel.add(topicNameLabel,BorderLayout.WEST);
		topDetailsPanel.add(subjectNameLabel,BorderLayout.CENTER);
		
		bottomDetailsPanel.setBackground(new Color(255,255,255));
		topDetailsPanel.setBackground(new Color(255,255,255));
		
		bottomDetailsPanel.add(professorNameLabel,BorderLayout.WEST);
		bottomDetailsPanel.add(departmentLabel,BorderLayout.CENTER);
		
		detailsPanel.add(topDetailsPanel,BorderLayout.NORTH);
		detailsPanel.add(bottomDetailsPanel,BorderLayout.SOUTH);
		detailsPanel.setBorder(new MatteBorder(0, 0, 0, 3, new Color(200,200,200)));
		
		//topPanel.setBorder(new EmptyBorder(20,20,20,20));
		detailsPanel.setBackground(new Color(255,255,255));
		ipPanel.setBackground(new Color(255,255,255));
		
		topPanel.add(detailsPanel,BorderLayout.CENTER);
		topPanel.add(ipPanel,BorderLayout.EAST);
		
		//ipPanel.setBorder(new CompoundBorder(new LineBorder(Color.YELLOW, 2), new EmptyBorder(0, 0, 0, 0)));
		ipPanel.addMouseListener(this);
		
		parentPanel.setBorder(BorderFactory.createEmptyBorder(15,40,20,40));
		parentPanel.setBackground(new Color(255,255,255));
		parentPanel.add(topPanel,BorderLayout.NORTH);
		tabbedPane.setBorder(new EmptyBorder(20, 0, 0, 0));
		parentPanel.add(tabbedPane,BorderLayout.CENTER);
		bottomPanel.setBackground(new Color(255,255,255));
		parentPanel.add(bottomPanel,BorderLayout.SOUTH);
		this.add(parentPanel);
		this.setMenuBar(menuBar);
		studentNumberComboBox.addActionListener(this);	
		
		newMenuItem.addActionListener(this);
		exitMenuItem.addActionListener(this);
		exportMenuItem.addActionListener(this);
		checkForNonSenseMenuItem.addActionListener(this);
		watchWaitingListMenuItem.addActionListener(this);
		
		//createBorderForMyPanels();
		waitingButton.addActionListener(this);
		tabbedPane.addChangeListener(this);
		searchField.addKeyListener(this);
	}