we can't copy/paste/compile/run your code due to the missing classes, particularly Square.
as your problem is to do with the display, create a sample program revolving around just adding the one square.
Get rid of everything unrelated to the problem of showing a single square when the program opens i.e. get rid of the listeners, the methods update/find/redraw etc
include a class Square, again get rid of everything from the square class if it is not related to its display.
you should now be able to post a very short 'working' program that displays the problem
in my battleship class, in the paintComponent() I have the following code:
I'm guessing that there is something wrong with me calling "board = new Board()" when I repaint...
so I just got rid of the "InitializeBoard()" method, and put that code in the constructor...
and it worked fine.
and when I click on a square, I called a "findSquare" routine which looks for a square on the board that contains the same X,Y coords captured by the mouseClicked() in BattleShip class.
then i UpdateBoard, and Color that Square white.
I just have one question regarding my ship objects...
ok:
1. my ship class extends JPanel - so I can use setEnabled, setToolTipText, etc... - also I can call this.getX(),this.getY() - and I can add a Mouse/Action/Key event directly to the component
ok, here is the question...
My board is drawn using drawRect and such... what would be a good way to tell if a square on my board contains a ship object?
should I grab the Point when clicked, and then check that point by saying: