You did some modification to the code JBuilder generates for you I see
You will need to design your screen and hook up the controls to enable the interaction.
You should also go for a proper object oriented approach, which would have the RMI functionality separate from the user interface.
That way you can do something like:
if (!GraphicsEnvironment.isHeadless()) {
// graphical environment available, launch GUI for interactive mode
MainFrame frame = new MainFrame(serverProps);
frame.validate();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
} else {
// no graphical subsystem, launch server without interactive mode
// using the values from the properties file
Server server = new Server(
Integer.parseInt(serverProps.getProperty("rmi.port")),
serverProps.getProperty("server.file"),
serverProps.getProperty("rmi.service"),
Integer.parseInt(serverProps.getProperty("server.timeout")));
try {
server.startServer();
} catch (RemoteException ex) {
System.err.println(server.getMessages());
return;
} catch (IOException ex) {
System.err.println(server.getMessages());
return;
}
}
to allow your server to also function on a machine that has no graphical shell using a configuration file to initialise it.
Mind I've not yet been able to actually test that code to see if the headless mode works, but I see no reason why it shouldn't.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.