{ if(i < 0) return; phone[i].setName(name.getText()); phone[i].setFlag(flag.getText()); phone[i].setPointer(pointer.getOffset()); phone[i].writeInfo(); selector.repaint(); }
{ if (i < 0) return; try { phone[i].setName(name.getText()); phone[i].setFlag(flag.getText()); phone[i].setPointer(pointer.getOffset()); phone[i].writeInfo(); selector.repaint(); } catch (NumberFormatException nfe) { JOptionPane.showMessageDialog(mainWindow, "Unable to save phone entry due to invalid input.\n" + "Please make sure that you use only hexidecimal\n" + "for the flag and point fields. The digits 0-9 \n" + "and the letters a-f are allowed. The flag field\n" + "should be two hex digits, a space, and another \n" + "two hex digits.", "Invalid input.", JOptionPane.ERROR_MESSAGE); } }
	private void saveInfo(int i)	{		if(i < 0) return;		phone[i].setName(name.getText());		phone[i].setFlag(flag.getText());		phone[i].setPointer(pointer.getOffset());		phone[i].writeInfo();		selector.repaint();	}