Randy Helene

+ Follow
since Apr 16, 2002
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Randy Helene

Never mind. I found my problems and got it working. Thanks anyway.
17 years ago
I'm new to Servlets and I am having a little trouble with an assignment. The assignment was to create an html form where the person enters First Name, Last Name, Address, Phone Number Fax Number, and email address, and a servlet that processes the information. The servlet should also check to see that all of the values are entered and display the information they entered. If any values are missing, it sends a page back to the user telling them to enter the information, with an "*" next to the fields that are missing.
I am having a problem with the logic getting the form to submit again, and filling in the fields in the form that were already entered. Thanks in advance for your help
17 years ago
I still need help. I tested out StreamTokenizer and it worked when I provided a string but it did not work with FileInputStream, counting the words in a file. Any other suggestions?
18 years ago
Can someone help me with this please?
Thank you.
18 years ago
Sorry, I forgot to include this. I can open the file and read it. Here is the code I have so far:
import java.io.*;
class FileI {
public static void main(String args[]) throws Exception {
FileInputStream fi=new FileInputStream("liberty.txt");
int ibytes = fi.available();
for (int i=0; i<ibytes; i++){
System.out.print((char)fi.read() );
18 years ago
I need some help on an assignment using uses FileInputStream, FileOutputStream, File classes. I need to open a text file containing several lines of text, count the number of words (separated by one or more spaces) and find the longest and shortest word. The summary should be printed at the console. I could use some help on how to go about this.
Thanks for your help.
18 years ago
Thanks for your help.
I did look at the link you gave me. I also figured out that I needed to get rid of the paint and repaint methods and add setText instead.
It works correctly now.
18 years ago
I have 2 applets that I need to merge into one. It is for a class, and my instructor says there is a very small amount that needs to be changed in the code.
The first one displays a simple banner. Besides merging it with the other applet, the String msg needs to be changed to a Label. I am having trouble with this because after changing it to a Label, the statements such as charAt and substring won't work. Here is the code:

The other applet is a calculator. The banner scrolls on top, and the calculator can be used while the banner is scrolling. I would appreciate any help you can give me with this.
Thanks in advance. Here is the calculator code.
18 years ago
Thank you for your help and comments. I learn something new each time I post something here.
18 years ago
Yes, that helps a lot. Hopefully that is what he had in mind. I do have a couple of questions about your code though.
1. Your import statements are different than mine, more specific. I am curious whether using more specific import statements, for example, import java.awt.event.ActionListener, rather than import java.awt.event.* makes performance better.
2. When I tried to compile your program with both classes in the same file, I got the error,

C:\java\MiniCalc.java:26: class Logic is public, should be declared in a file named Logic.java
public class Logic
So I tried taking the public off the public class logic statement. Why does that matter?
18 years ago
I have a calculator applet for a homework assignment, and I need to split it up into 2 classes. Here is the code.

When the instructor was talking about this, the whole class was confused. He wants us to begin the new class with the actionPerformed logic and we have to pass the values of the text fields from the CalcMini class, to the next class which he called class Logic. The way he was passing the values had something to do with using the this keyword. I am not sure how to do this. Can someone please help.
18 years ago
Thank you for your help. I'm still a bit confused, but hopefully I'll work it out.
18 years ago
I will try the tags next time.
I still need help with the logic, please.
Thank you.
18 years ago
I was not sure which board to post this on because it is about an assignment that is partially an application and partially an applet.
I am taking a class and it this is my homework assignment. I could use some help:
We have to develop a Rectangle Class with the following requirements:
- the class contains 3 private instance variables: width, length, color
- the class contains a variable called ID used for assigning a unique serial number to each object of that type: ID can be read but not changed.
- Rectangle can be constructed four different ways:
1. by specifying width, length, color
2. by specifying width, length
3. by specifying width (to create a square)
4. by specifying nothing(to create an object with default size)
Rectangel class contains methods for:
-computing the area
-drawing the rectangle using its color field
Rectangle class also contains the following methods:
setLength - for setting the length of the rectangle
setWidth - for setting the width of the rectangle
getLength - for returning the length of the rectangle
getWidth - for returning the with of the rectangle
equals - for checking to see whether two rectangles are identical( return true or false)
We have to write the class such that the height and width can only have values between 10 and 100. In other words, if the values are less than 10, they should equal 10, and if they are more than 100, they should equal 100.
There are 2 test classes we need to use to test the Rectangle class with. One is the following:

The second one is the following:

So far this is what I have, and I know it is all wrong. I would appreciate any help you could give me to clean it up:

[ April 21, 2002: Message edited by: Dirk Schreckmann ]
18 years ago