Reputation: 432
I'm trying to create a JFrame
with the dimensions of my screen, so I tried to use the statement Toolkit kit = new Toolkit();
but it turns red and eclipse tells me "cannot instantiate the type Toolkit". So then I tried Toolkit kit = new Toolkit.getDefaultToolkit();
and that didn't work either. Help!!!
Upvotes: 0
Views: 207
Reputation: 69470
Remove the new
keyword:
Toolkit kit = Toolkit.getDefaultToolkit();
The method getDefaultToolkit
is a static method. See the documentation for more details.
Upvotes: 1