This is an undo feature button on a calculator that I am writing. undo is the button Status is a class that holds my status. listOfStates is an ArrayList of Status. displayBox is a object of JTextFeild. What I do not under stand is that when I display previousState in the text box I get something like: Status@11dc088. I know I am missing casting something here. Thanks for any help.
if(e.getSource() == undo)
{
Status previousState = (Status) listOfStates.get(listOfStates.size()- 1);
displayBox.setText(" ");
displayBox.setText(displayBox.getText() + previousState);
System.out.println(previousState);
}