Betty Christiansen

Greenhorn
+ Follow
since Apr 12, 2014
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Betty Christiansen

Thank you, I'll work on it using your suggestions.
4 years ago
JSP
Extreme beginner here. Trying a simple form with a text field and a submit button; the text field should start with zero and increment by 1 every time a user clicks it. I know this is basic stuff but I'm trying to learn this on my own and can't find the answers online. Any help would be greatly appreciated as it's the only way I'm going to learn.
My HTML


My JSP
4 years ago
JSP
Bill and Bear, Thank you for the advice...added to my next steps in learning!
5 years ago
Got it figured out...not the most elegant that's for sure, but I'm learning.

5 years ago
No I'm afraid I'm not sure how to do that in eclipse. I'm basically trying to learn how these different pieces interact by writing small programs that I run on my own computer. I realize I don't have a deep understanding of all the best practices but as I work through small exercises like this I am learning; especially from experts on these forums. Thank you for the hint, I will continue to research.
5 years ago
I'm hoping I can ask this question here; if not please redirect me. I hava a very simple HTML form with a textField for a name, and add button to add the name to a MySQL database, and a sort button to sort the names in the database and display them. I almost have it working, however when I hit the "sort" button; I get the message that appears after a user clicks the add button along with the sorted list of names. It looks like this:
Please go back and add a name or sort.
Bill Jones
David G
Debbie Downer
Jane Doe
Joe Smith
John Doe
Mike Jones
Paul Smith
Susan Jones

Would someone be able to advise me on what I have to change on my code to make just the list show up by itself when the user clicks sort?

My servlet code:



My HTML form code
5 years ago
I always try to make things harder than they are. Thank you, that works perfectly!!

New JSP code:

5 years ago
JSP
Here is the HTML code:

5 years ago
JSP
For a class assignment I have to write a JSP program that will get the name and gender from a simple HTML form and then provide feedback to the user such as "Enter your name" if they leave that field blank. The HTML form has a textField for the name and two radio buttons for male and female, plus a submit button. We covered JSPs only briefly so along with being a Java newbie, JSPs are pretty foreign. I had written the same program as a servlet so I attempted using the similar code for the JSP. I'm using switch to get the gender from the radio buttons but that doesn't seem to work as I keep getting the response "Please select your gender". Could someone spot where I might have taken a wrong turn here?

My JSP code (please be gentle):

5 years ago
JSP
I have designed an applet to simulate a stack (last-in, first-out) of strings. The applet consists of:

Two JButtons
Two JTextFields
Two JLabels
A TextArea

The user enters text in the first text field then clicks the push button and it goes in the textArea. After entering several strings the user can click the pop button and the top string goes into the second text field. I am a total newbie and am stuck. I can get a string of text to push to the textArea and then pop it out; however I can't stack them LIFO. Most examples I've seen use integers and I'm not sure how to translate the concept to strings. I'm just not sure how the stack concept works even though I read the API webpage. Does anyone have an example that might help me progress.

My code

5 years ago
Figured it out...I wasn't too far off to begin with but your hints helped me along. Thank you.

Final code:
5 years ago
You are absolutely correct, I am a beginner all around. No offense taken. I should also add I am struggling to keep up in a course I'm taking that was listed as beginning programming with no pre-reqs, so there's that.
5 years ago
So now I can get a list of numbers to display but how to add them together is my next question. Do I need a sum variable? Also, now my catch exception isn't working but I think I can figure that out. Any hints are appreciated. My code as it is now...
5 years ago
Hmmm, when I change it to:


and then enter some numbers in the textArea I don't get any output in my console, however when I put in just one number it prints that number out. What this is telling me is that I need a way to recognize each line input into the textArea. I tried using split but that didn't seem to do anything, my console remains blank with multiple numbers input but will still display one number.

5 years ago
I am feeling fairly stupid for not being able to figure out this seemingly simple code. I have a GUI with a textArea for the user to input numbers, a button which should "listen" for those numbers, and then a textField to display the sum. I have my code working for user input of one number; but I'm at a loss as to what sort of loop I need to create to get it to read each line of input. I wasn't sure whether to put this in the beginner forum or here, because I am definitely a beginner.

So my code thus far that works with one input:

5 years ago