Hello all,
I have a problem with this bit of code:
/**
* Private method for setting up the table.
*/
private void setupTable()
{
setLayout(new BorderLayout()); //added
//sets up the playing table
//creates the playing surface
myTable = new TheTable(thePlayers);
//sets size
myTable.setSize(1024, 768);
//add listener
myTable.addWindowListener(this);
//adds title to frame
myTable.setTitle("Portland v0.02b, (C)2004 Clements Software");
//shows the table
myTable.show();
add(myTable, "Center"); //added to layout
}
The compiler returns:
Exception in thread "main" java.lang.IllegalArgumentException: adding a window to a container
at java.awt.Container.addImpl(Container.java:616)
at java.awt.Container.add(Container.java:518)
at TheDealer.setupTable(TheDealer.java:130)
at TheDealer.<init>(TheDealer.java:33)
at Portland.main(Portland.java:5)
Now I have had this running before about a year ago and have just come back to it on a new machine.
I will be thankfull for any help,
Harold Clements