public BargraphExternal(){
		System.out.println("external started");
		currentQuestion = "";
		size=0;
		participantCount = 0;
		buffer = 10;
		width = 600;
		height = 400;
		frame = new JFrame();
		//graphPanel = new JPanel();
		frame.setSize(width+80, height+80);
		this.setMinimumSize(new Dimension(width, height));
		frame.add("Center", this);
		runRead = true;
		initializeGraph();
		//validWidgetPositions = new ArrayList<Integer>(8);
		try {
			s = new ServerSocket(9745);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		new Thread(new Runnable(){

			@Override
			public void run() {
				try {
					Socket client = s.accept();
					in = new BufferedReader(new InputStreamReader(client.getInputStream()));
					client.setSoTimeout(100);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
				while(runRead){
					try{
						String input = in.readLine();
						
						String[] inputParts = input.split("`!:");
						if(inputParts[0].equalsIgnoreCase("ID") ){
							setID(inputParts[1]);
						} else if(inputParts[0].equalsIgnoreCase("STATUS")){
							setActiveStatus(Boolean.parseBoolean(inputParts[1]));
						} else if (inputParts[0].equalsIgnoreCase("QUESTION")){
							setQuestion(inputParts[1]);
						} else if (inputParts[0].equalsIgnoreCase("ANSWERS")){
							inputData(inputParts[1]);
						} else {
							System.out.println("Unknonwn answer received: "+input);
						}
					} catch (SocketTimeoutException e){
						
					} catch (Exception e){
						e.printStackTrace();
					}
				}
			}}).start();
	}