package rmitest; import java.awt.Font; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import javax.swing.JLabel; public class SquarerImpl extends UnicastRemoteObject implements Squarer { private static final long serialVersionUID = 1L; JLabel label; public SquarerImpl() throws RemoteException { label = new JLabel("ready"); label.setFont(new Font("helvetica", Font.BOLD, 24)); new DisplayFrame("server", label); } public int square(int x) throws RemoteException { label.setText(""+x); return x*x; } public Squarer getNewSquarer() throws RemoteException { return new SquarerImpl(); } }