Typcasting to a JButton
I'm playing with buttons and action listener, and I need to take a captured object and cast it as a JButton so I can use its positioning methods (I want to click one button, then another, and have them switch positions)
public void actionPerformed(ActionEvent e)
{
Object selected = e.getSource();
//JButton temp = selected;
}
Can Objects be typecast in Java? I found a page that said you could define any object up or down an inheritance tree and it would be fine, but that's not the case.
Any help would be appreciated. Thanks.

