• Post Reply Bookmark Topic Watch Topic
  • New Topic

getContentPane in applet?  RSS feed

 
Tim Alvord
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a Java Applet defined as follows:



When I try and get the ContentPane I get the following error:

Checkers.java:23: error: cannot find symbol
Container pane = getContentPane();
_____________^
symbol: method getContentPane()


Any ideas? This works fine if the class is not an applet...
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Alvord wrote:When I try and get the ContentPane I get the following error:

Checkers.java:23: error: cannot find symbol
Container pane = getContentPane();
_____________^
symbol: method getContentPane()

Any ideas?

The class doesn't have a method called getContentPane(), so when you try to call it, it won't work.

Tim Alvord wrote: This works fine if the class is not an applet...

Not true:

This code will cause the same error. So when does the error not happen? (hint, it isn't about what Checkers is not, it is about what Checkers is).

Anyway, your question is very specific, but doesn't really get at the heart of your problem. What are you trying to do that you can't? The how you have chosen (the getContentPane()) won't work because you don't have that method. But you need to think about the WhatNotHow (<- link)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!