need simple help.....
Im confused why this isnt working....
Any ideas? What have I stupidly missed?
Thanks,
Peter
-----------------------------
import javax.swing.*;
import java.awt.*;
import java.util.*;
public class CAS2_Interface extends JPanel{
CAS_Engine theCAS_Engine;
public static void main(String[] args)
{
JFrame mainWindow = new JFrame("CASAT - Connect a Square on a
Tesseract (Multiplayer)");
JPanel content = new JPanel();
content.add(new CAS2_Interface(), BorderLayout.WEST);
mainWindow.setContentPane(content);
mainWindow.getContentPane().setBackground(new
Color(176,196,222));
mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWindow.setLocationRelativeTo(null);
mainWindow.pack();
mainWindow.setVisible(true);
}
public void CAS2_Interface()
{
setPreferredSize(new Dimension(600,471));
setBackground(new Color(173,216,230));
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
drawScreen((Graphics2D) g);
}
public void drawScreen(Graphics2D g)
{
//Uses the game board as defined in the program specification
Image image = Toolkit.getDefaultToolkit().getImage("./
map.png");
g.drawImage(image, 0,0,this);
}
}