william keelman

Greenhorn
+ Follow
since May 02, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by william keelman

I want to do it so I can run my program as a .exe
17 years ago
Does anyone know a free Java to C++ converter?
17 years ago
I have a java program and wonder is there a way to run it on computers with just jre and not jdk?
17 years ago
I am new to programing and Java. I created this awesome Java program that makes webpages using html...right now it is texted based (works from cmd)...could you please tell me how to make it into an application...Also, If this is posted in the wrong area...please feel free to move it...
17 years ago
Will nothing you said help, but someone who knew nothing of Java fixed it so I am closing this post.
17 years ago
now I only have 24 errors (all the same type)...here is what is at the top:
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.Writer;
public class myhtmler
{
public static void main (String args [])
{

And here is a sample of one of the 24 lines with pretty much the same idea:

file.write("</html>");

like i mentioned 1238817489719872389127 times I do not think "file.write" is a valid command...if not what is?

Just for reference CMD said with the new changes:

D:\>javac myhtmler.java
myhtmler.java:74: cannot find symbol
symbol : variable file
location: class myhtmler
file.write(" ");
^
myhtmler.java:75: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<html>");
^
myhtmler.java:76: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<head>");
^
myhtmler.java:77: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<title>" + name + "'s Web page </title>");
^
myhtmler.java:78: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("</head>");
^
myhtmler.java:79: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<body bgcolor=" + col + ">");
^
myhtmler.java:80: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<font color=" + fcol + ">");
^
myhtmler.java:81: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<font size=" + size + ">");
^
myhtmler.java:82: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<font face=\"" + face + "\">");
^
myhtmler.java:83: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<h1>" + name + "'s Page </h1>");
^
myhtmler.java:84: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<h2> Designed with MyHtmler </h2>");
^
myhtmler.java:85: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<p> " + info + "</p>");
^
myhtmler.java:86: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<p> " + infoa + "</p>");
^
myhtmler.java:87: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<p> " + infob + "</p>");
^
myhtmler.java:88: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<p> " + infoc + "</p>");
^
myhtmler.java:89: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<p> " + infod + "</p>");
^
myhtmler.java:90: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<img src=\"" + img + "\"width=\"" + w + "\"height=\"
" + h + "\">");
^
myhtmler.java:91: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<img src=\"" + imga + "\"width=\"" + wa + "\"height=
\"" + ha + "\">");
^
myhtmler.java:92: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<img src=\"" + imgb + "\"width=\"" + wb + "\"height=
\"" + hb + "\">");
^
myhtmler.java:93: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<img src=\"" + imgc + "\"width=\"" + wc + "\"height=
\"" + hc + "\">");
^
myhtmler.java:94: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("<img src=\"" + imgd + "\"width=\"" + wd + "\"height=
\"" + hd + "\">");
^
myhtmler.java:95: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("</font>");
^
myhtmler.java:96: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("</body>");
^
myhtmler.java:97: cannot find symbol
symbol : variable file
location: class myhtmler
file.write("</html>");
^
24 errors

P.S. I still have my old version as comments...so feel free to try something as long as it won't mess up my computer...
17 years ago
CMD SAID THIS:

D:\>javac myhtmler.java
myhtmler.java:21: cannot find symbol
symbol : class Writer
location: class myhtmler
Writer fw = new FileWriter(fileName);
^
myhtmler.java:22: cannot find symbol
symbol : class Writer
location: class myhtmler
Writer bw = new BufferedWriter(fw);
^
myhtmler.java:73: cannot find symbol
symbol : variable file
location: class myhtmler
file.write (" ");
^
myhtmler.java:74: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<html>");
^
myhtmler.java:75: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<head>");
^
myhtmler.java:76: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<title>" + name + "'s Web page </title>");
^
myhtmler.java:77: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("</head>");
^
myhtmler.java:78: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<body bgcolor=" + col + ">");
^
myhtmler.java:79: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<font color=" + fcol + ">");
^
myhtmler.java:80: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<font size=" + size + ">");
^
myhtmler.java:81: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<font face=\"" + face + "\">");
^
myhtmler.java:82: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<h1>" + name + "'s Page </h1>");
^
myhtmler.java:83: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<h2> Designed with MyHtmler </h2>");
^
myhtmler.java:84: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<p> " + info + "</p>");
^
myhtmler.java:85: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<p> " + infoa + "</p>");
^
myhtmler.java:86: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<p> " + infob + "</p>");
^
myhtmler.java:87: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<p> " + infoc + "</p>");
^
myhtmler.java:88: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<p> " + infod + "</p>");
^
myhtmler.java:89: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<img src=\"" + img + "\"width=\"" + w + "\"height=\
"" + h + "\">");
^
myhtmler.java:90: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<img src=\"" + imga + "\"width=\"" + wa + "\"height
=\"" + ha + "\">");
^
myhtmler.java:91: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<img src=\"" + imgb + "\"width=\"" + wb + "\"height
=\"" + hb + "\">");
^
myhtmler.java:92: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<img src=\"" + imgc + "\"width=\"" + wc + "\"height
=\"" + hc + "\">");
^
myhtmler.java:93: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("<img src=\"" + imgd + "\"width=\"" + wd + "\"height
=\"" + hd + "\">");
^
myhtmler.java:94: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("</font>");
^
myhtmler.java:95: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("</body>");
^
myhtmler.java:96: cannot find symbol
symbol : variable file
location: class myhtmler
file.write ("</html>");
^
26 errors

I do not thing that file.write is a valid command, what do I type instead? Also, there was something wrong with the thing you gave me, although I think it is closer that what I had had before.
[ May 02, 2006: Message edited by: william keelman ]
17 years ago
now I believe that there is also something wrong with
BufferedWriter file = new BufferedWriter(new FileWriter(input.nextLine()));

Thanks and Please respond as soon as possible,
Will
17 years ago
Okay...still need help please...
17 years ago
I am trying to get my java program to write to a file so...
I have this at the top:
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.FileWriter;

Then have this later:
System.out.println ("Please enter the name of the file that you want to create:");
BufferedWriter file = new BufferedWriter(new FileWriter(input.nextLine()));

Then I want to add aditional info to the file (it will be saved as an html file):
file.write ("<p> " + info + "</p>");


I believe it has something to do with file.write but idk please tell me

Thanks
17 years ago