grid[targetheight][targetwidth].setValue(variable)
So, there is a specific element of this matrix at targetheight and targetwidth. I want to modify this element using a method only available to WhiteBox, setValue. But since setValue isn't a method declared by the interface Box, I am SOL. How can I access it? Grid is supposed to store a bunch of boxes, but some of those boxes are different and I want to do different things to them. I am so confused please help.
EDIT: Why does
((WhiteBox) grid[targetheight][targetwidth]).setValue(v);
work but
(WhiteBox) grid[targetheight][targetwidth].setValue(v);
doesn't?