Article View: aus.computers.java
Article #476Anyone tell me what's wrong with my code?
From: Entrepreneur
Date: Sun, 24 Sep 2000 00:00
Date: Sun, 24 Sep 2000 00:00
1216 lines
33719 bytes
33719 bytes
I wrote this code to do file transfer for plain text file.
I can't see the problem. I'm not 100% sure but to be on safe side
it's best to type the directory and filename as case sensitive
entities.
Here goes. If anyone wants to use it feel free Tell me what's wrong
with it if u can :)
public class CommApp
{
public static void main(String[] args)
{
Menu m = new Menu();
m.run();
}
}
//console version
/* Client.java
* Request file from the server
*
*
*
* CLASS NAME:
* Client
*
* PUBLIC FEATURES:
*
* //Constructor
* public Client(Comms comms)
*
* //Methods
* public void fileReceive()throws Exception
*
* COLLABORATORS:
* Comms
*
*/
import java.io.*;
class Client
{
public static final byte STX = 02; //Start of Text
public static final byte ETX = 0; //End of Text
public static final byte DLE = 10; //Data Link Escape
public static final byte ETB = 17;
public static final byte ACK = 13; //Acknowledgement
public static final byte NAK = 15; //Non-Acknowledgement
public static final char endOfLine = '\n';
// Define instance variable
private Comms comms;
private boolean toDebug = true;
private char [] chtest = new char[20];
private int fnamelen;
// Constructor
public Client(Comms comms)
{
this.comms = comms;
}
public void fileReceive(String fileName) throws Exception
// Connect with the server, request and receive file from the server
{
File file;
RandomAccessFile receiveFile;
//String fileName;
StringBuffer tempFileName;
/*
System.out.print("File Name for search: ");
do
{
fileName = new BufferedReader(new InputStreamReader
(System.in)).readLine();
}while(fileName.length()== 0);
System.out.println();
*/
System.out.println("Sending file " + fileName + "...\n");
//tempFileName = tmpFileName.trim();
// tempFileName = new StringBuffer(""); //initialise buffer to
empty
tempFileName = new StringBuffer(fileName);
// tempFileName.setLength(20);
// for(int i = 0; i < tempFileName.length(); i++)
// {
// tempFileName.append(fileName.charAt(i));
// }
for(int i = 0; i < tempFileName.length(); i++)
{
comms.write((int)tempFileName.charAt(i));
//storeChars(tempFileName.charAt(i));
}
// storeLen(tempFileName.length());
comms.write(endOfLine);
if ( comms.read() != ACK)
{
if (toDebug)
System.out.println("Receiving NAK...\n");
System.out.println("File " + fileName + " not found on the
server...\n");
}
else //(comms.read() == ACK)
{
if(toDebug)
System.out.println("Receiving ACK ...\n");
System.out.println(" Filename transferred successfully!\n");
// create a file to store the data received from the server
file = new File(fileName);
receiveFile = new RandomAccessFile(file, "rw");
comms.write (ACK);
if(toDebug)
System.out.println("Sending ACK...\n");
System.out.println("CLIENT Ready to receive data...\n");
readFile(receiveFile);
}
}// end of fileReceive()
private void readFile(RandomAccessFile receiveFile) throws Exception
{
boolean finished = false;
boolean receiveCRC = false;
boolean receiveFrameNo = true;
int frameSize = 0;
int frameNo = 0;
int theFrameNo = -1;
CRC16 crc16 = new CRC16();
short crc;
int temp1,temp2;
StringBuffer receiveBuffer = new StringBuffer();
while (!finished)
{
temp1 = (comms.read());
if (temp1 == STX && receiveFrameNo)
{
if (toDebug)
System.out.println("Receiving STX...\n");
receiveBuffer = new StringBuffer();
frameSize = 0;
frameNo = comms.read();
if (toDebug)
System.out.println("Receiving frame Number: " +
frameNo + "...\n");
receiveFrameNo = false;
}
else if (temp1 == DLE)
{
temp2 = (comms.read());
if (temp2 == DLE)
{
receiveBuffer.append((char) temp1); //Append data
into receiveBuffer
frameSize = frameSize + 1;
}
else if (temp2 == ETB)
{
receiveFrameNo = true;
receiveCRC = true;
if (toDebug)
System.out.println("Receiving ETB...\n");
}
else if (temp2 == ETX)
{
receiveFrameNo = true;
finished = true;
receiveCRC = true;
if (toDebug)
System.out.println("Receiving ETX...\n");
}
if (receiveCRC)
{
crc = (short)((comms.read() <<8)+(comms.read()));
//System.out.println("crc = "+comms.read());
if (toDebug)
{
System.out.println("Receiving Data Block "+
frameSize);
System.out.println("Receiving CRC
checksum...\n");
}
receiveCRC = false;
if ((frameNo != theFrameNo)) //check for sequence
//if expected frame no is different from the
received frame no,
//error checking and append to the receiveFile
{
for (int i = 0; i < frameSize; i++)
{
crc16.update((int) receiveBuffer.charAt(i));
}
System.out.println("checksum = " +
crc16.getValue());
System.out.println("Receiving checksum = " +
crc);
//if(true)
if (crc == crc16.getValue())
//append receiving data to the buffer, if crc
checksum is correct
{
for (int i = 0; i < frameSize; i++)
{
receiveFile.write((int)
receiveBuffer.charAt(i));
}
comms.write(ACK);
if (toDebug)
System.out.println("Sending ACK...\n");
theFrameNo = frameNo;
}
else
comms.write(NAK);
crc16.reset();
}
else
{
if (toDebug)
System.out.println("Ignore duplicate
frame: " + frameNo + "\n");
}
frameSize = 0;
}
}
else
{
receiveBuffer.append((char) temp1); //append data into
receiveBuffer
frameSize = frameSize + 1;
}
}// end of while(!finish)
System.out.println("File received successfully!\n");
System.out.println(fnamelen);
System.out.println("The size of the file downloaded from the
SERVER is ");
System.out.println(receiveFile.length() + " bytes....");
System.out.println("END of file transmission process.........");
receiveFile.close();
}//end of readFile()
int i = 0;
public void storeChars(char c)
{
do
{
chtest[i] = c;
System.out.println("Storing char " + i);
}while(c!='\0');
}
public void storeLen(int l)
{
fnamelen = l;
}
} // End of class Client
import java.io.*;
import java.net.*;
import Keyboard;
public class ClientSetUp
{
private int baudInt;
private int port;
public void run()
{
try
{
System.out.println("Enter IP address of SERVER-> ");
String IPString = new BufferedReader(new InputStreamReader
(System.in)).readLine();
System.out.println("Enter filename to download -> ");
String fn = new BufferedReader(new InputStreamReader
(System.in)).readLine();
int port = Keyboard.readInt("Enter port no-> ");
this.port = port;
int baud = Keyboard.readInt("Enter baud rate -> ");
baudInt = baud;
LinkMgr ln = new LinkMgr(IPString, port, baudInt, false, fn);
ln.run();
}
catch (Exception e)
{
System.out.println (e);
}
}
}
import java.io.*;
import java.net.*;
public class Comms {
boolean isServer;
String serverHostName;
int portNumber;
long baudRate;
long lastTransferTime;
ServerSocket serverSocket;
Socket socket;
InputStream inStream;
OutputStream outStream;
public Comms (String serverHostName, int portNumber, boolean
isServer, int baudRate) throws IOException {
this.serverHostName = serverHostName;
this.portNumber = portNumber;
this.isServer = isServer;
this.baudRate = baudRate;
if (isServer) {
serverSocket = new ServerSocket (portNumber);
}
else {
}
}
public boolean connect () {
try {
if (isServer) {
serverSocket.setSoTimeout (0);
socket = serverSocket.accept ();
}
else {
socket = new Socket (serverHostName,
portNumber);
}
inStream = socket.getInputStream ();
outStream = socket.getOutputStream ();
} catch (SocketException e) {
return false;
} catch (IOException e) {
return false;
}
lastTransferTime = System.currentTimeMillis ();
return true;
}
protected boolean timeForNextTransfer () {
if ((baudRate > 0) && (System.currentTimeMillis () -
lastTransferTime < (1000 / baudRate / 9) ))
return false;
else
return true;
}
public boolean available () throws IOException {
if (! timeForNextTransfer ())
return false;
else
return (inStream.available () > 0);
}
public int read () throws IOException {
int received;
while (! timeForNextTransfer ()) { }
lastTransferTime = System.currentTimeMillis ();
received = inStream.read ();
return received;
}
public void write (int value) throws IOException {
while (! timeForNextTransfer ()) { }
outStream.write (value);
lastTransferTime = System.currentTimeMillis ();
}
protected void finalize() throws Throwable {
System.gc();
}
}
/* CRC16.java
* An utility class to calculate CRC16 checksum for
* a stream in the form of array of bytes.
*
*
* CLASS NAME:
* CRC16
*
* PUBLIC FEATURES:
*
* //Constructor
* public CRC16()
*
* //Methods
* public short getValue()
* public void reset()
* public void update(int b)
* public void update( byte[] b, int off, int len)
*
* COLLABORATORS:
* -
*
*/
public class CRC16
{
private long checksum = 0xffff;
public CRC16()
{
checksum = 0xffff;
}
public short getValue()
{
return (short)checksum;
}
public void reset()
{
checksum = 0xffff;
}
public void update(int b)
{
checksum ^= b << 8L;
for( int i=0; i < 8; i++)
{
checksum =(( checksum & 0x8000) != 0x0000 ? ((checksum << 1L)
^ 0x1021):( checksum << 1L));
}
}
public void update( byte[] b)
{
for( int i = 0 ; i < b.length; i++)
{
update( (int) b[i] );
}
}
}
import java.util.Date;
import java.text.*;
/** Keyboard methods to read numbers and strings from standard input
(usually
* KEYBOARD) with retry when invalid input. The class has methods
which read
* things from the keyboard terminated by <Enter>. Most of the
methods of
* this class have two versions, one with a prompt parameter and the
other
* without. The latter versions have a default prompt, except for
* readString().
* (version 1.7) limits number of retries, readString terminates on -
1.
* (version 1.8) modifies readString() so that it handles CRLF
('\r''\n')
* for JDK 1.1.4 - abo - 25 November 1997
* (version 1.9) modified readDate() and readWord() to remove the
calls to
* JDK 1.02 deprecated methods for JDK 1.1 code
* and also for VisualCafe 2.0 Bug in flush()
**
* CLASS NAME:
* Keyboard
*
* PUBLIC FEATURES:
* // Data
*
* // Constructors
*
* // Methods:
*
* public static String readString()
* public static String readString(String prompt)
* // Read a string from the console, the string is terminated by a
newline
* // Returns the input string (without the newline). No prompt
unless
* // supplied.
*
* public static int readInt()
* public static int readInt(String prompt)
* public static long readLong()
* public static long readLong(String prompt)
* public static float readFloat()
* public static float readFloat(String prompt)
* public static double readDouble()
* public static double readDouble(String prompt)
* // Reads a number from the console, the input is terminated by a
newline.
* // If the input is not a valid representation of the number's type
* // it display's an error message and retries, re-prompting if
applicable.
* // Returns a numeric value of the indicated type. After 5 tries
returns 0.
* // Adds space to prompt if supplied, effective default prompt
is ": ".
*
* public static Date readDate()
* public static Date readDate(String prompt)
* // Reads a date from the console, the input is terminated by a
newline.
* // If the input is not a valid date representation as defined in
the
* // java.util.Date class it display's an error message, re-
prompting if
* // applicable and retries. After 5 tries it returns the current
date.
* // Adds space to prompt if supplied, effective default prompt
is ": ".
* // Returns a Date object.
*
* public static void pause()
* public static void pause(String prompt)
* // Pauses execution and waits for the user to press <ENTER> or
NEWLINE ('\n')
* // If not supplied as a parameter the default prompt is
* // "Press Enter to continue......."
*
* public static String readWord()
* // Returns a 'word' from the console. A word is any group of
characters
* // terminated by whitespace (one or more ' ', '\t', '\n'). No
prompt.
* public static void flush()
* // Ignore the rest of the current line, ie. flush the input stream
* // discarding any contents up to '\n' inclusive. Does nothing if
* // '\n' is last char read. Only useful after readWord().
*
* COLLABORATORS:
*
*/
import java.util.Date;
import java.text.*;
public class Keyboard
{
// Class variables
private static int lastChar = 0; // used by readWord, flush,
pause
private static int endOfLine = 10;
private static int endOfFile = -1;
// Methods
public static String readString()
// Read a string from the console, the string is terminated by a
newline
// Returns the input string (without the newline). No prompt.
{
int ch = 0;
String r = "";
boolean done = false;
while (!done)
{
try
{
ch = System.in.read();
if (ch < 0 || (char)ch == '\n')
done = true;
// 'r' test added on 25/11/97 for JDK 1.1.4
// readString() now works - abo
else if ( (char) ch != '\r')
r = r + (char) ch;
}
catch(java.io.IOException e)
{
done = true;
return null;
}
}
lastChar = ch;
return r;
}
public static String readString(String prompt)
// readString() with prompting
{
System.out.print(prompt + " ");
System.out.flush();
return readString();
}
public static int readInt()
// readInt() with default ":" prompt
{
return readInt(":");
}
public static int readInt(String prompt)
// Reads an integer from the console, the input is terminated by a
newline.
// If the input is not a valid integer representation it display's an
// error message, re-prompts and retries.
// Returns an int
{
int count = 5;
while (count > 0)
{
System.out.print(prompt + " ");
System.out.flush();
try
{
return Integer.valueOf(readString().trim()).intValue();
}
catch(NumberFormatException e)
{
System.out.println ("Not an integer! Please try again.");
}
--count;
}
System.out.println ("Too many retries -- treated as zero.");
return 0;
}
public static long readLong()
// readLong() with default ":" prompt
{
return readLong(":");
}
public static long readLong(String prompt)
// Reads a long integer from the console, the input is terminated by
a newline.
// If the input is not a valid integer representation it display's an
// error message, re-prompts and retries.
// Returns a long integer.
{
int count = 5;
while (count > 0)
{
System.out.print(prompt + " ");
System.out.flush();
try
{
return Long.valueOf(readString().trim()).longValue();
}
catch(NumberFormatException e)
{
System.out.println ("Not an integer! Please try again.");
}
--count;
}
System.out.println ("Too many retries -- treated as zero.");
return 0L;
}
public static float readFloat()
// readFloat() with default ":" prompt
{
return readFloat(":");
}
public static float readFloat(String prompt)
// Reads a floating point number from the console,
// the input is terminated by a newline.
// If the input is not a valid floating point representation it
// display's an error message, re-prompts and retries.
// Returns a floating point number.
{
int count = 5;
while (count > 0)
{
System.out.print(prompt + " ");
System.out.flush();
try
{
return Float.valueOf
(readString().trim()).floatValue();
}
catch(NumberFormatException e)
{
System.out.println ("Not a floating point number! Please
try again.");
}
--count;
}
System.out.println ("Too many retries -- treated as zero.");
return 0.0F;
}
public static double readDouble()
// readDouble() with default ":" prompt
{
return readDouble(":");
}
public static double readDouble(String prompt)
// Reads a double precision floating point number from the console,
// the input is terminated by a newline.
// If the input is not a valid double representation it display's an
// error message, re-prompts and retries
// Returns a double precision floating point number
{
int count = 5;
while (count > 0)
{
System.out.print(prompt + " ");
System.out.flush();
try
{
return Double.valueOf
(readString().trim()).doubleValue();
}
catch(NumberFormatException e)
{
System.out.println ("Not a floating point number! Please
try again.");
}
--count;
}
System.out.println ("Too many retries -- treated as zero.");
return 0.0;
}
public static Date readDate()
// readDate() with default ":" prompt
{
return readDate(":");
}
public static Date readDate(String prompt)
// Reads a date from the console, the input is terminated by a
newline.
// If the input is not a valid date representation as defined in the
// java.util.Date class it display's an error message, re-prompts
// and retries.
// Returns a date
{
Date result;
int count = 5;
while (count > 0)
{
System.out.print(prompt + " ");
System.out.flush();
try
{
// replaced JDK 1.02 return new Date(readString()) with
// following line - abo 8/12/97
result = DateFormat.getDateInstance().parse(readString());
return result;
}
// replaced JDK 1.02 catch(IllegalArgumentException e)
// abo - 8/12/97
catch(ParseException e)
{
System.out.println("Not a valid date format! Please try
again.");
}
--count;
}
System.out.println ("Too many retries -- treated as today.");
return new Date();
}
public static void pause()
// Pauses execution and waits for the user to press <ENTER> or
NEWLINE ('\n')
// Displays default prompt 'Press Enter to continue......' before
pausing.
{
pause("\nPress Enter to continue.......");
}
public static void pause(String prompt)
// Pauses execution and waits for the user to press <ENTER> or
NEWLINE ('\n')
// Displays prompt before pausing.
// (Bug fixes for use with file input. ABO 29/4/97, RKA 5/5/97)
{
System.out.print(prompt + " ");
System.out.flush();
try
{
lastChar = System.in.read();
// System.out.println("now" + lastChar); // abo debug
}
catch(java.io.IOException e)
{
}
flush();
}
public static String readWord()
{
int ch = 0;
String r = "";
boolean done = false;
boolean haveSpace = true;
while (!done)
{
try
{
ch = System.in.read();
// replaced isSpace() with isWhitspace() for JDK 1.1
// abo - 8/12/97
haveSpace = ch < 0 || Character.isWhitespace((char)ch);
if (!haveSpace)
r = r + (char) ch;
else if (r.length() != 0 || ch < 0) // (v1.7) ch < 0
done = true;
// System.out.println("ch=" + ch); // rka debug
}
catch(java.io.IOException e)
{
done = true;
System.out.println("IOException"); // rka debug
break;
}
}
lastChar = ch;
return r;
}
public static void flush()
// Flush the input stream up to first '\n' unless '\n' just read.
// New version (1.6) rka
// New Version (1.9) abo for {} around String ignore = readString()
{
if (lastChar != endOfLine && lastChar != endOfFile)
{
String ignore = readString();
}
}
} // end Keyboard
import java.io.*;
import java.net.*;
import Keyboard;
public class ServerSetUp
{
private int baudInt;
private int port;
public void run()
{
try
{
System.out.println("Enter IP address of SERVER-> ");
String IPString = new BufferedReader(new InputStreamReader
(System.in)).readLine();
int port = Keyboard.readInt("Enter port no-> ");
this.port = port;
int baud = Keyboard.readInt("Enter baud rate -> ");
baudInt = baud;
LinkMgr ln = new LinkMgr(IPString, port, baudInt,
true, "");
ln.run();
}
catch (Exception e)
{
System.out.println (e);
}
}
}
/* Server.java
* response to the client's request- searching and sending files
* CLASS NAME:
* Server
*
* PUBLIC FEATURES:
*
* //Constructor
* public Server(Comms comms)
*
* //Methods
* public void fileTransfer() throws Exception
*
* COLLABORATORS:
* Comms
*
*/
import java.io.*;
import java.net.*;
class Server
{
public static final byte STX = 02; //Start of Text
public static final byte ETX = 0; //End of Text
public static final byte DLE = 10; //Data Link Escape
public static final byte ETB = 17;
public static final byte ACK = 13; //Acknowledgement
public static final byte NAK = 15; //Non-Acknowledgement
public static final char endOfLine = '\n';
// Declare instance variable
private Comms comms;
private boolean toDebug = true;
public Server(Comms comms)
{
this.comms = comms;
}
public void fileTransfer() throws Exception
// and response for the client's request
{
StringBuffer receiveBuffer;
String fileName = new String();
char temp;
RandomAccessFile file;
System.out.println("Receiving file name request from
CLIENT: ");
// read input from client
receiveBuffer = new StringBuffer();
while ((temp = (char) comms.read()) != endOfLine)
{
System.out.print(temp);
receiveBuffer.append(String.valueOf(temp));
}
fileName = receiveBuffer.toString();
System.out.println("");
System.out.println("Files in current SERVER directory -> ");
filedir fdir = new filedir();
fdir.run("c:\\");
System.out.println();
System.out.println("SERVER is seeking file " + fileName
+ "...\n");
if (! (new File(fileName)).exists())
{
System.out.println("File not found!\n");
comms.write(NAK);
if(toDebug)
System.out.println("Sending NAK...\n");
}
else
{
comms.write(ACK);
if(toDebug)
System.out.println("Sending ACK...\n");
if (comms.read() == ACK)
{
if(toDebug)
System.out.println ("Receiving ACK...\n");
file = new RandomAccessFile(fileName,"r");
file.seek(0);
System.out.println("SERVER is sending file to
CLIENT...\n");
sendFile(file);
}
}
}//end of file_transfer()
private void sendFile(RandomAccessFile file) throws Exception
// Start method TransferFile()
{
CRC16 crc16= new CRC16();
boolean eof = false;
boolean readData = true;
boolean timeOut = true;
byte[] dataBuffer = new byte[128];
byte[] a = new byte[1];
int noOfCharacter = 0;
int frameNo = 0;
int i = 0;
int count = -1;
while ((! eof) || (timeOut))
// While not end of file or time does run out
{
if (readData) // making 128 byte Frame
{
count = -1;
for (i = 0; i < dataBuffer.length && noOfCharacter != -
1; i++)
{
noOfCharacter = file.read(a);
if (noOfCharacter != -1)
{
dataBuffer[i] = a[0];
count = i;
}
else
eof = true;
}
}
if (count > -1) //sending Frame
{
comms.write (STX);
if (toDebug)
System.out.println("Sending STX...\n");
comms.write (frameNo);
if (toDebug)
System.out.println("Sending frame Number " + frameNo
+ "...\n");
if (toDebug)
System.out.println("Sending Data Block: " + (count
+ 1)+ "\n");
for (i = 0; i <= count; i++)
{
if (dataBuffer[i] == DLE)
comms.write(DLE);
comms.write(dataBuffer[i]);
}
comms.write (DLE); //character stuffing
if (! eof)
{
comms.write (ETB);
if (toDebug)
System.out.println("Sending ETB...\n");
}
else
{
comms.write (ETX);
if (toDebug)
System.out.println("Sending ETX...\n");
}
}
else //if (count <= -1) End of sending Frame
{
comms.write (STX);
if (toDebug)
System.out.println("Sending STX...\n");
comms.write(frameNo);
if (toDebug)
System.out.println("Sending FRAME NUMBER " +
frameNo + "...\n");
comms.write (DLE);
comms.write (ETX);
if (toDebug)
System.out.println("Sending ETX...\n");
}
//Error checking by CRC16
crc16.reset();
crc16.update(dataBuffer);
short tempcrc=crc16.getValue();
comms.write ((tempcrc & 0xff00) >> 8);
comms.write (tempcrc & 0xff);
System.out.println("sending checksum = " + crc16.getValue
());
if(toDebug)
System.out.println("Sending CRC checksum...\n");
comms.socket.setSoTimeout(5000); // Set the time out for
5 seconds
timeOut = false;
try
{
i = comms.read();
}catch (IOException e){timeOut = true;}
if (!timeOut)
{
if (i == ACK) //transmit next frame
{
if (toDebug)
System.out.println("Receiving ACK...\n");
frameNo = frameNo + 1;
readData = true; //make the next frame
}
else if (i == NAK)
// retransmit the Frame, if the client receive an
incorrect frame (different checksum)
{
if (toDebug)
System.out.println("Receiving NAK...\n");
readData = false; //Don't make the next frame
}
}
else //if timeout & no ACK received, retransmit the frame
{
if (toDebug)
System.out.println("Timeout waiting for ACK...\n");
readData = false; //Don't make the next frame
}
comms.socket.setSoTimeout(0); //set the time out for 0
second
}//end of while ((! eof) || (timeOut))
file.close();
if (!toDebug)
System.out.println("File is successfully transfered!\n");
} // End of method TransferFile()
} // End of class
import Keyboard;
import java.lang.*;
import java.io.*;
public class Menu
{
public void run()
{
System.out.println("TCP Client Server Application");
System.out.println("Please select: ");
System.out.println();
System.out.println("1. Client");
System.out.println("2. Server ");
System.out.println("3. Baud");
System.out.println("4. OK");
System.out.println("?");
System.out.println();
int choice = Keyboard.readInt("?");
switch(choice)
{
case 1:
ClientSetUp c = new ClientSetUp();
c.run();
break;
case 2:
ServerSetUp s = new ServerSetUp();
s.run();
break;
case 3:
System.out.println("not yet!");
break;
case 4:
System.exit(0);
break;
}
}
}
--
"Graduate from the university of life and you
will have more wisdom than all PhDs put
together......"
Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID:
<8qjtu5$g52$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,15e1129a175cbc36 X-Google-Attributes: gid10d6db,public From: Entrepreneur <tutorsrus@my-deja.com> Subject: Anyone tell me what's wrong with my code? Date: 2000/09/24 Message-ID: <8qjtu5$g52$1@nnrp1.deja.com> X-Deja-AN: 673401953 X-Http-Proxy: 1.1 x55.deja.com:80 (Squid/1.1.22) for client 202.92.95.120 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun Sep 24 03:54:51 2000 GMT X-MyDeja-Info: XMYDJUIDtutorsrus Newsgroups: aus.computers.java X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; Mozilla/4.0 (compatible; MSIE 5.0; Windows 95/98/NT; GoConnect Australia Pty Ltd))