-
Help with text area
Okay I have a form with 3 text boxes and 3 checkboxes in a group, What i want to do is Print out the Text Box information along with the name of the chekbox that was checked, I can't figure it out, What i have is I'm sending the textbox info to a string then printing it out, then i created if statements for the checkboxes, but they won't work at the same time. Is there some way I can keep the data the same if I hit the enter button so the existing data won't dissappear and is there a way to print out in the textarea both information of textboxes and checkboxes the user selects? Thanks for help
public void actionPerformed(ActionEvent event) {
String who = event.getActionCommand();
if(who.equals("Exit")){
System.exit(0);
}
Object source = event.getSource();
if (source == btnenter) {
String stname = txtname.getText();
String styear = txtyear.getText();
String strunning = txtrunning.getText();
txtarea.setText("Movie Name: " + stname + " Year: " + styear + " Time it Runs: " + strunning);
if (chkgood.getState()) {
txtarea.setText("Movie is Good");
}
if (chkokay.getState()) {
txtarea.setText("Movie is Okay");
}
if (chkbad.getState()) {
txtarea.setText("Movie is Bad");
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks