Let's create a simple panel , that will display just "Hello World!".
We will just extend AbstractPanel.
public class HelloWorldPanel extends AbstractPanel {
}
But that's not enough. We should implement show() , since AbstractPanel is an abstract class. show() method is used to return the html code used by the browser to display our panel.
public class HelloWorldPanel extends AbstractPanel { public String show() {
StringBuffer sb = new StringBuffer();
sb.append("<CENTER>\n<H1>\nHello World !\n</H1>\n</CENTER>\n"); return sb.toString();
}
}
HelloWorldPanel class should be in panels package defined in persistence.cfg by PANELS_PACKAGE parameter. persistence.cfg should be in the CLASSPATH.
The same applies to all the panels and forms.
Now that's all. If you'll load the panel , you'll see something like this:
Pay attention to the URL , that's how panels are loaded - using main servlet .