Saturday, March 13, 2010

Building GUI applications

There are various open source plugins available for developing GUI application. Here I am consider about Eclipse IDE. The easiest way to develop GUI is to use the Visual Editor, I will recommend that it is easy to use the Visual Editor plug-in with Eclipse 3.3 Europa.

More on RMI

I am writing this post the usage of IntelliJ IDEA users, who need to run RMI application using the IDE.
For the IntelliJ IDEA user-
First go to the settings-> compiler -> rmi compiler -> enable it

Then you have to set the VM parameters (run config) for the class that

need to compile and run as a RMI application. Following is how to do it.
-Djava.rmi.server.codebase=file:///c://project_name/out/

c: - indicate the disk drive where your project located
out - indicate the out folder of your project


Folliwing code description shows how to run RMI registry from the source code. Before all the RMI logic start initialize this code and you will not need to run the rmi registry manually in your computer.

Process rmi = null;
try{
rmi = Runtime.getRuntime().exec("rmiregistry");
Thread.sleep(5000);
}
catch (IOException ex){
//exception handling logic here
}
catch (InterruptedException exc){
//exception handling logic here
}