| Author |
Java GUI development question.
|
Caitlin Gibson
Greenhorn
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 information. 3). Read the JPasswordField and compare it to a hard-coded value. Here is the code: Any help would be most appreciated, Thanks, -Caitlin. (edited by Cindy to format code using [ code][ /code] tags) [ November 26, 2002: Message edited by: Cindy Glass ]
|
 |
Cindy Glass
"The Hood"
Sheriff
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
|
 |
 |
|
|
subject: Java GUI development question.
|
|
|