public final void initUI() {

		coords = new int[100][2];
		count = 0;

		JPanel panel = new JPanel();
		panel.setLayout(null);

		setTitle("Lines");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(300, 200);
		setLocationRelativeTo(null);

		addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent event) {
				if (event.getButton() == MouseEvent.BUTTON1) {
					int x = event.getX();
					int y = event.getY();

					coords[count][0] = x;
					coords[count][1] = y;
					count++;
				}

				if (event.getButton() == MouseEvent.BUTTON3) {
					drawLines();
					count = 0;
				}
			}
		});
	}