I am not sure why they are doing that. I initially set the size of the panel to a specific height and width, wouldn't get height and get width return that height or width? My code is below...
gameWindow()
{
super();
JButton button = new JButton("start");
JFrame f = new JFrame("Missle Command, Part Duex!");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(getUIPanel(), "Last");
f.addMouseListener(new pointsListener());
f.setSize(500,800);
f.setLocation(200,200);
f.setVisible(true);
f.add(this);
.
.
.
}
This code returns 0...
public city(JPanel thePanel, int pos, int pos2)
{
//constructor
double gameXX = thePanel.getWidth();
double gameXY = thePanel.getHeight();
System.out.println("The height and x Position of the Variables "+gameXX+" " +gameXY);//<-I get zero when I print this. Strange!
.
.
.
}