Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting user input and RMI

843793Jun 2 2003 — edited Jun 24 2003
Dear all,

I'm still new to Java, so any pointers would be much appreciated.

I have a program that uses RMI to for example, ask a use to select a language for the rest of the trnsaction to take place in. The problem is that whilst I can output the clients message to the message pane - I'm at a loss at to how I allow the user to input a number form the menu so that this can be sent back to the server. Here's the code I have:
Anna :-)

public class InternationalClient {

public InternationalAccount ia;

public InternationalClient(){

try{
ia =(InternationalAccount)
Naming.lookup("rmi://localhost/PreferredLanguage");

System.out.println(ia.selectLanguage()); //See below for method

}
catch (Exception e) {System.out.println (e);}
}

public static void main(String []args){
InternationalClient ic = new InternationalClient();
}
}

Method held in the implementation of the account object on the server:

public String selectLanguage()throws RemoteException{
Return "Please select a language: 1 English, 2 Nederlands, 3 Italiano, 4 Portugu�s \n";
}

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2003
Added on Jun 2 2003
1 comment
200 views