import java.rmi.Naming; import java.rmi.NotBoundException; import java.rmi.RemoteException; import javax.swing.JOptionPane; public class ClientOperation { private static RMIInterface look_up; public static void main(String[] args) throws RemoteException { try{ look_up = (RMIInterface) Naming.lookup("//localhost/MyServer"); String txtNum1 = JOptionPane.showInputDialog("Enter number1"); int number1=Integer. parseInt(txtNum1); String response1 = look_up.mult(number1); String response2 = look_up.div(number1); String response=response1+"\n"+response2; JOptionPane.showMessageDialog(null, response); } catch(Exception e){ System.err.println("Server exception: " + e.toString()); e.printStackTrace(); } } }