I've been working on a Chess program GUI.
I've set this up as JButtons in a GridLayout, except I made a subclass of JButton (JGridButton) that stores its position on the gird.
To find out from which JButton the event was fired, I'm using getSource() (Is there any other way to do this?).
Since this returns an Object and not the specific object type that it was from, I'm currently casting it as a JGridButton.
My question is - what exactly is going on here when I cast it? Does the information (about the position) get passed on?
Upon review I think this might be better of in the New to Java since the question really isn't GUI specific.