then I 've created an interface to use as remote
then I implments the main class created with JBuilder with my interface,
everything compile and I can execute but it doesn't show anything of my
program.
Here is the code
What can be wrong?
Thanks
package es.uned.dia.sd.practica.comparadorrmi;
import javax.swing.UIManager;
import java.awt.*;
import java.rmi.*;
import java.rmi.server.*;
//RemoteCompare is my Interface
public class ServidorFicheros extends UnicastRemoteObject implements
RemoteCompare {
boolean packFrame = false;
CompareResults cr = new CompareResults();
String directoryName = "";
//Construct the application
public ServidorFicheros() throws java.rmi.RemoteException {
main frame = new main();
//Validate frames that have preset sizes
//Pack frames that have useful preferred size info, e.g. from their
layout
if (packFrame) {
frame.pack();
}
else {
frame.validate();
}
//Center the window
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);
}
public CompareResults equal(String hash, String fileName, String
hashAlgorithm) throws RemoteException {
return cr;
}
public String getDirectoryName() throws RemoteException {
return directoryName;
}
//Main method
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception e) {
e.printStackTrace();
}
try {
if (System.getSecurityManager() == null){
System.setSecurityManager(new java.rmi.RMISecurityManager());
}
ServidorFicheros sf = new ServidorFicheros();
}catch(Exception e) {
}
}
}
Also, did you register the server?