my dog learned polymorphism
The moose likes Java in General and the fly likes Java GUI development question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java GUI development question." Watch "Java GUI development question." New topic

Java GUI development question.

Caitlin Gibson

Joined: Nov 25, 2002
Posts: 12
Hi all.
I wrote the following program a few days ago and I don't know how to
add the following features:
1). If the fname or lname textfield contains a certain string ( such as
a specific name ), create a new JButton on the frame.
2). When a student's name is selected from the combo box, lauch a new
frame with a photo of that student inside the new frame along with
several labels and corresponding textfields that contain the relevant
3). Read the JPasswordField and compare it to a hard-coded value.
Here is the code:

Any help would be most appreciated,
(edited by Cindy to format code using [ code][ /code] tags)
[ November 26, 2002: Message edited by: Cindy Glass ]
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
1. Check the fname and lname fields by using getText() and then using a Regex expression to look for your string.
2. Do you have a database holding the student info? Assuming that you don't and you have a finite set of students you could use a case statement to check to see if the text of the selected student matches. Then it is just a matter of showing the image and whatnot.
3. Use the getPassword() method to find the array of bytes that makes up the Password.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: Java GUI development question.
It's not a secret anymore!