Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

awt help  RSS feed

 
simrat khanuja
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code:


error:

D:\jpro>javac Awt.java
Awt.java:7: error: cannot find symbol
PasswordFeild p1=new PasswordFeild(25);
^
symbol: class PasswordFeild
location: class Awt
Awt.java:7: error: cannot find symbol
PasswordFeild p1=new PasswordFeild(25);
^
symbol: class PasswordFeild
location: class Awt
Awt.java:14: error: cannot find symbol
c=getContentPane();
^
symbol: method getContentPane()
location: class Awt
Awt.java:28: error: cannot find symbol
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
^
symbol: variable EXIT_ON_CLOSE
Awt.java:32: error: cannot find symbol
Awt ob=Awt("AWT..");
^
symbol: method Awt(String)
location: class Awt
5 errors
 
Tim Cooke
Marshal
Posts: 3632
184
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is telling you that it doesn't know what a PasswordFeild is. Aside from the obvious misspelling of Field (i before e) you don't have any import statements that tell the compiler where to find it. It is not present under "java.awt.*".

Edit: Also, when posting code it is recommended to UseCodeTags (<- click link) as it makes your code much more readable which in turn makes it more likely people will bother to read it and help you. I've added them for you this time along with code indentation. See how much better it looks?
 
simrat khanuja
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what does error 3,4,5 mean??
and which package we have to import apart from awt to make it work
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3 and 4 mean that neither your class nor it's parent classes implement a getContentPane or setDefaultCloseOperation method. A JFrame has those methods but a Frame is not a JFrame.
5 means that your class does not have an Awt method. It does have a constructor, but there's something missing on line 32 that means that line is not creating a new Awt object but is calling an Awt method.
 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using AWT classes instead of Swing or JavaFX?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!