public GUI(){
	super("DNS DB with B+ Tree");
	setDefaultCloseOperation(EXIT_ON_CLOSE);

	dnsDB = new DNSDB();

	setLayout(new BorderLayout());
	ipText = new JTextField();
	ipText.setColumns(15);
	ipText.addKeyListener(new KeyAdapter() {

		@Override
		public void keyReleased(KeyEvent e) {
		    validateButton();
		}
	    });
	nameText = new JTextField();
	nameText.setColumns(15);
	nameText.addKeyListener(new KeyAdapter() {

		@Override
		public void keyPressed(KeyEvent e) {
		    validateButton();
		}
	    });

	JPanel labels = new JPanel();
	labels.setLayout(new BoxLayout(labels, BoxLayout.Y_AXIS));
	labels.add(new JLabel("IP: "));
	labels.add(Box.createVerticalStrut(10));
	labels.add(new JLabel("Name: "));
	labels.setBorder(new EmptyBorder(5, 5, 5, 5));

	JPanel fields = new JPanel();
	fields.setLayout(new BoxLayout(fields, BoxLayout.Y_AXIS));
	fields.add(ipText);
	fields.add(Box.createVerticalStrut(5));
	fields.add(nameText);
	fields.setBorder(new EmptyBorder(5, 5, 10, 5));

	add(labels, BorderLayout.WEST);
	add(fields, BorderLayout.CENTER);

	actionButton = new JButton();
	actionButton.setMaximumSize(new Dimension(250, 50));
	actionButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
		    handleAction();
		}
	    });

	addButton = new JButton();
	addButton.setMaximumSize(new Dimension(250, 50));
	addButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
		    handleAdd();
		}
	    });

	validateButton();

	JPanel buttonPanel = new JPanel();
	buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
	buttonPanel.add(actionButton);
	buttonPanel.add(Box.createVerticalStrut(5));
	buttonPanel.add(addButton);
	add(buttonPanel, BorderLayout.SOUTH);


		
	JButton iterateAll = new JButton("Iterate All Pairs");
	iterateAll.setMaximumSize(new Dimension(250, 50));
	iterateAll.addActionListener(new ActionListener() {
			
		@Override
		public void actionPerformed(ActionEvent e) {
		    dnsDB.iterateAll();
		}
	    });
		
	JButton runTest = new JButton("Run Test");
	runTest.setMaximumSize(new Dimension(250, 50));
	runTest.addActionListener(new ActionListener() {
			
		@Override
		public void actionPerformed(ActionEvent e) {
		    JFileChooser chooser = new JFileChooser(".");//System.getProperty("user.dir"));
		    int res = chooser.showOpenDialog(GUI.this);
		    if(res == JFileChooser.APPROVE_OPTION){
			dnsDB.testAllPairs(chooser.getSelectedFile());
		    }
		}
	    });
		
	buttonPanel.add(Box.createVerticalStrut(5));
	buttonPanel.add(iterateAll);
	buttonPanel.add(Box.createVerticalStrut(5));
	buttonPanel.add(runTest);

	setLocationRelativeTo(null);
	pack();
	setVisible(true);
    }