View Single Post
  #1 (permalink)  
Old 08-06-2007, 06:54 PM
coco coco is offline
Member
 
Join Date: Jul 2007
Posts: 39
coco is on a distinguished road
Help with Grid Layout
Hello, I'm trying to write a game in Java. The Sea Battle game where you should hit and sink the opponents ships...
It has to be in a field 10x10 squares and i had written the code for a square.
Code:
import java.awt.*; import javax.swing.*; public class Tile extends JButton{ public Tile() { super(""); } public void paintComponent (Graphics g) { g.setColor (getForeground()); } }
But i have know idea what to do next. I know I should put them in a Grid Layout, but how the hell should I program the ships?
Thanks.
Reply With Quote
Sponsored Links