alright, i have ship objects, and the ship class extends JPanel..
now when i first enter my GUI, I can move the ships around on the
board, but as soon as i click in the chatTextField, the ships go un-focusable, and i cant move them any more..
why is this?
also, is there any method like JPanel.contains(point(x,y)); ?
You down with OOP? Yeah you know me!
Joined: Jul 15, 2003
There's a Swing forum here at the JavaRanch where this topic would be more at home. Regardless, there's a few things that are odd. First of all, a JPanel is a container and isn't generally a focus owner to begin with. The decision to have "Ship" extend JPanel seems dubious at best. You're also going to need to post some code to show us what you're doing and what the problem is before we can help further. I can't divine why you can't move your ship after clicking on a text field but I can tell it almost certainly has little to do with it being "unfocusable".
Look up Component.contains(int,int) for the answer to your other question. I'd link it but the forum software won't let me.