*
The moose likes Beginning Java and the fly likes Very simple question! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Very simple question!" Watch "Very simple question!" New topic
Author

Very simple question!

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Hi,
If i have one function called open(). It will do some process, afterthat i want to return the error message from that function.
How to return error message in java? Would you please explain by simple example?
Thanks in advance,
angela
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
Hi, Angela.
I think you just want to declare that open() throws an exception, then catch it in your code.

Or am I missing something?
Art
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Thanks Art,
But my question is different. Let me more specific.
I have one class , in that I am displaying Error messages in Dialog Box.
I have another class in that I have Open socket method. If there is something wrong in opening socket,I want to return some value which indicates that socket open failed, that value I want to display in Error message class with dialog box. Now Dialog Box will have two buttons: Retry and Cancel. If somebody click on Retry , it should open the socket again.
Plz let me more specification, if you need,
Thanks
angela

Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
You could put this code in a function, then just call the function again if the user wants to retry.

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Thanks Angela Ann,
Angela
Originally posted by Angela Ann:
[B]You could put this code in a function, then just call the function again if the user wants to retry.
[/B]

 
 
subject: Very simple question!