aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes dynamic passing of parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "dynamic passing of parameter" Watch "dynamic passing of parameter" New topic
Author

dynamic passing of parameter

sam sawant
Greenhorn

Joined: Mar 26, 2009
Posts: 12
i want to pass value of text field of 1 frame to a function which is another java class file

as we did this using constructor,we are geting error io.exception should be thrown or caught
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

Apparently, some statement in the constructor can throw an IOException. As the error says, you must either catch that IOException, or add "throws IOException" to the constructor signature.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sam sawant
Greenhorn

Joined: Mar 26, 2009
Posts: 12
if i throw io.exception then it becomes incompatible
where to add that catch? to constructor?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39814
    
  28
Your subject line doesn't tell what the thread is about.

It is difficult to work out where the best place to catch an Exception is, especially since you provided so little detail. But try in the method which calls the constructor. If you have an Exception in the constructor, then you might be best off not creating the object, but declaring the Exception instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic passing of parameter