Getting user input and RMI
843793Jun 2 2003 — edited Jun 24 2003Dear 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";
}