import java.net.MalformedURLException; 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 txtNum2 = JOptionPane.showInputDialog("Enter number2"); int number2=Integer. parseInt(txtNum2); String response = look_up.halfMul(number1, number2); JOptionPane.showMessageDialog(null, response); } catch(Exception e){ System.err.println("Server exception: " + e.toString()); e.printStackTrace(); } } }