473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to get my error message to display? and how do I get my clear button to work?

I have attached the coding that I have so far. I am a beginner, and I am self teaching through a book. I can't figure out why my System.out.println isn't displaying anything, also I have a clear button which I did code as
Expand|Select|Wrap|Line Numbers
  1. clearButton.addActionListener(this);
but nothing, I know I need something in there for it to know to clear the fields, but I can't find it so far in my book.
Thanks
Mark
Attached Files
File Type: txt Checkerboard.txt (2.9 KB, 256 views)
Feb 26 '11 #1

✓ answered by Dheeraj Joshi

In actionPerformed method you need to find out what is the action command. And depending on action command. You can perform things you need to do.

Expand|Select|Wrap|Line Numbers
  1. public void actionPerformed(ActionEvent e)
  2. {
  3.         if(e.getActionCommand().equals("Clear")){
  4.      ....
  5.         ....            
  6.     }
  7. }
  8.  
And secondly, System.out.println redirects the output to the console. You can not see it unless you registered to default console.

Please display the exception as error text in the GUI.

Regards
Dheeraj Joshi

1 1483
Dheeraj Joshi
1,123 Expert 1GB
In actionPerformed method you need to find out what is the action command. And depending on action command. You can perform things you need to do.

Expand|Select|Wrap|Line Numbers
  1. public void actionPerformed(ActionEvent e)
  2. {
  3.         if(e.getActionCommand().equals("Clear")){
  4.      ....
  5.         ....            
  6.     }
  7. }
  8.  
And secondly, System.out.println redirects the output to the console. You can not see it unless you registered to default console.

Please display the exception as error text in the GUI.

Regards
Dheeraj Joshi
Feb 28 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Iver Erling Årva | last post by:
I have the following function which I call from a <input type="button">'s onclick event: function showHideSub(cntrl,varclass){ var myclass = varclass; DIVColl=document.all.tags("tr"); if...
3
by: Paul | last post by:
I have an Access 2000 database with a form that is giving me some major headaches. When you open the form, it displays all records and allows editing, but has AllowAdditions set to False so that...
9
by: JTrigger | last post by:
When I compile my project using the IDE on a development machine it works just fine. When I compile it on the server using csc.exe, I get the following error when I try to bring it up in the web...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have developed a form that would allow the user to load and search a database several ways, by data range, by specific number or all database entries. I can successfully load any of the ways...
4
by: Dale Levesque | last post by:
I get this message. any ideas?? See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text **************...
2
by: c676228 | last post by:
Hi, I have several user controls like email, phone,ssn etc. each has it's own validation message in its user control already. When I bring all those user controls in an aspx page, I would like to...
8
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful...
2
by: Ming | last post by:
Hi there, Is there a handy way to show error message instead of error code when uploading? For example, if I get error code 3 (UPLOAD_ERR_PARTIAL), I can directly show users that 'Only part...
3
by: user1980 | last post by:
hi.. I have a text box with a custom validator, compare field validator. I have a problem with the error message display. my compare field validator works normally....ie; when I enter a wrong...
1
by: inbarik | last post by:
Hi, i'm getting syntax error message for this button that tries to get name (of building) with apostrophe. Any idea how to solve this? Note that i must use name with apostrophe e.g. O'neal: ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.