aspose file tools*
The moose likes Beginning Java and the fly likes need help with string array using methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help with string array using methods" Watch "need help with string array using methods" New topic
Author

need help with string array using methods

Jere Johnson
Greenhorn

Joined: Mar 29, 2003
Posts: 28
Hello,
This program compiles correctly, but
i cant seem to get anything to appear on my applet screen except for the textField with the current program down below. Can anyone see a problem, i cant?
i think im seeing doubles, since ive been looking at
this program for 30 hours.


__________________

(Marilyn added code tags)
[ March 30, 2003: Message edited by: Marilyn de Queiroz ]

Diapers are the best invention
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
First of all, you should edit your post and use the CODE tags so that it preserves your indentation. This will make it much easier for us to read.


Java API Documentation
The Java Tutorial
Jere Johnson
Greenhorn

Joined: Mar 29, 2003
Posts: 28
Why does everybody on this JavaRanch site seem so uptight about "the right thing to do".
Im not getting any answers with my posts, Just you should do this and that!
what kind of a site is this?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Maybe it is because we expect people that ask questions to show some courtesy. Remember we aren't paid for helping you, so we at least want some respect and some sign that you are willing to put effort into it. The code you posted definitely shows that you are putting effort into it. Editing the indentation style was just a small suggestion. It shouldn't take you all that much time. It seems to me that YOU are the one that's uptight about this. Please don't take offense from a suggestion that was intended to help us help you more efficiently.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Show a little respect when you ask questions and you will find lots of people who will try and help you. If you spend any time at this site most posts which contain code make use of the *code* tags. It makes the post easyer to read. The easyer it is to read the question the better chance you have of getting an answer.
At the moment it is the weekend, so you don't have as many people showing up to read your question, which may be one reason you are not getting as many responses as you were expecting.


Please ignore post, I have no idea what I am talking about.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Also, if you spell correctly, your post will be easier to read.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Spelling errors don't bother me, since I can't spell myself.
People who write "u" for "you" and "r" for "are" do bother me. That and the fact that these same people seem to have a hard time with correct grammer usually make the posts really had to read.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
It was just the smart ass in me coming out. I didn't mean it too seriously. I usually can get past bad spelling, and even bad grammar sometimes. I usually take bad grammar to mean that English is their second language. To me, that means they should be encouraged to keep working at it and not condemned for their little mistakes. I apologize if my facetiousness came across too seriously...
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Hey, someone who knows what they are doing, help this guy out. Thanks.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Program looks incomplete to me. How can I compile and run it when there is stuff missing ?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Jere Johnson
Greenhorn

Joined: Mar 29, 2003
Posts: 28
Im getting more dos and donts.
told ya :roll:
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

I'm a little bit confused as to what the program is supposed to accomplish. However, the error seems to be in the display method:

What was happening was that the Strings was being displayed all on top of each other outside the bounds of the applet's viewable area.
This of course begs the question, why?, but I think that this should get you started now.
[ April 01, 2003: Message edited by: Joel McNary ]

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Problems:
Your program has no indentation, which makes it needlessly difficult for us to understand.
Your program does not compile because you didn't include enough of the program text to make it compile. Again, making it needlessly difficult for us to understand.
I made some guesses at what might be missing, added proper indentation, and also added some System.out.println() statements to see what was going on:

It looks like the main problem is that you always call readData() from inside paint(), and your event handler does input.setText(null) immediately before calling repaint(). This means that any time you call readData(), the data being read is just a null. Try commenting out the input.setText(null) for starters. I can't really tell what your program is supposed to be doing, but at least with the println() statements you'll have a better idea what it actually is doing.


"I'm not back." - Bill Harding, Twister
Jere Johnson
Greenhorn

Joined: Mar 29, 2003
Posts: 28
Jim,
The input.setText(null) statement doesnt do anything but blank out the TextField after
you hit enter. Thats it.
As for the program:
I want to display 10 strings on the applet after
i enter 10 strings into the TextField.
i get the program to run with entering a string in the textField outputs the string in the applet. Yet, doesnt return 10 different strings on a seperate line.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
This works fine for me in AppletViewer

Thankyou for the chance to learn about Applets today.
[ April 01, 2003: Message edited by: Barry Gaunt ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Jeremiah Coleman:
Im getting more dos and donts.
told ya :roll:

What else did you come here for then if not for us to tell you how to do your program or what not to do in your program?
Jere Johnson
Greenhorn

Joined: Mar 29, 2003
Posts: 28
Barry you are a KING!!
Program works great. Thanks for your
ideas from your motor cranium.
Rock on bro! Beers on me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help with string array using methods