• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot read error

 
Sartaj Syed
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to compile the following file Iget the error message Cannot read. It does not seem to be a path problem as other files in the same directory are compiling,
import java.awt.*;
public class FS1 extends Frame{
FS1(){
super("Feedback");
setSize(500,500);
//Build and add Panel3.
Panel p3 = new Panel();
Label L1 = new Label("Project Continued on Revision #");
TextField T1 = new Textfield);
T1.setBackground(Color.grey);
T1.setEditable(true);
p3.add(L1);
p3.add(T1);
add(p3, BorderLayout.SOUTH);
}
}
public static void main(string args[]){
FS1 fs = new FS1();
fs.setvisible(true);
}}
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you named the file FS1.java and not something like fs1.java or Fs1.java.
ps there are numerous compile errors in this file.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also be sure that you saved it as a .txt file and not accidently as a .doc format.
 
Sartaj Syed
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use JEdit that saves all files as .java.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
It's nice when the code is formatted.

Problem: TextField is TextField, not Textfield. And you're missing the opening parenthesis.
Another Problem: Your main() is outside of the class programming block! And you have one too many closing brackets. Move main() into class programming block. Remove extra closing bracket.
Another Problem: String is String, not string. See the parameters of your main().
Another Problem: gray is gray, not grey.
Another Problem: setVisible(boolean) is setVisible(boolean), not setvisible(boolean).
Make these corrections, and it will compile.
Good Luck!
[ January 15, 2002: Message edited by: Dirk Schreckmann ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic