Selecting value from a JList and passing it.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jyri_Saastamoinen
Posted On:   Wednesday, April 9, 2003 11:00 PM

Why error occurs when I pass the selected value from a Jlist to a another class like: CenterOhja o = new CenterOhja(); // this is the class where i put the value from a JList. ........................... String name = (String)list.getSelectedValue(); Bean b = new Bean(); b.setName(name); b = o.getCenter(name); // this method in class CenterOhja gets object from a database with selection criteria name and. BUT, this call throws an error which I can't see from a command prompt. Help if U can    More>>

Why error occurs when I pass the selected value from a Jlist to a another class
like:

CenterOhja o = new CenterOhja(); // this is the class where i put the value from a JList.

...........................

String name = (String)list.getSelectedValue();


Bean b = new Bean();


b.setName(name);


b = o.getCenter(name); // this method in class CenterOhja gets object from a database with selection criteria name and.
BUT, this call throws an error which I can't see from a command prompt. Help if U can

   <<Less
About | Sitemap | Contact