I have this code and in it there is a function to convert binary to decimal. It sets the text of a JTextArea to the result and appends the result to a different JTextArea. The former works fine but the latter causes the above mentioned exception to appear. This is my code below. Pls help.
JButton numerical = new JButton("BIN->NUM");
numerical.setFont(small);
numerical.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Display.setText(String.valueOf(Integer.parseInt(Display.getText(), 2)));
try {
Memory.append(String.valueOf(Integer.parseInt(Display.getText(), 2)));
Memory.append("\n");
} catch (Exception ie) {
Memory.append(String.valueOf(Integer.parseInt(Display.getText(), 2)));
}
}
});