The Artima Developer Community
Sponsored Link

Java Answers Forum
HELP: Simple Applet

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
ben

Posts: 2
Nickname: boa
Registered: Jun, 2003

HELP: Simple Applet Posted: Jun 12, 2003 7:23 AM
Reply to this message Reply
Advertisement
I've written an applet that accesses a file, but the write process isn't working.

This is the code that writes to the file:

try
{
file = NAME + ".txt";

FileWriter FileWrit = new FileWriter (file);

BufferedWriter BuffWrit = new BufferedWriter (FileWrit);

PrintWriter PrinWrit = new PrintWriter (BuffWrit);

PrinWrit.print (HIGH + " ");
PrinWrit.print (TOTAL + " ");
PrinWrit.print (GAMES);

PrinWrit.close();
}

Catch (IOException exception)
{
Title.setText (exception + "");
}

"file" is an empty String variable
"NAME" is a String variable holding the player's username
"HIGH", "TOTAL", and "GAMES" are all integer variables.

You can get the whole source code at http://www.geocities.com/benoaustin/Game.java

Can someone tell me what I've done wrong?

Topic: Client Previous Topic   Next Topic Topic: applet

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use