A simple HelloWorld project written in Java.
package samples;
import org.dwcj.App;
import org.dwcj.controls.button.Button;
import org.dwcj.controls.button.events.ButtonClickEvent;
import org.dwcj.controls.label.Label;
import org.dwcj.controls.panels.AppPanel;
import org.dwcj.exceptions.DwcAppInitializeException;
public class HelloWorldJava extends App {
@Override
public void run() throws DwcAppInitializeException {
AppPanel panel = new AppPanel();
panel.setStyle("display", "inline-grid");
panel.setStyle("gap", "20px");
panel.setStyle("margin", "20px");
panel.setStyle("padding", "20px");
panel.setStyle("border", "1px dotted");
panel.add(new Label("Hello World"));
Button btn = new Button("Say Hello");
panel.add(btn);
btn.setTheme(Button.Theme.DANGER);
btn.setExpanse(Button.Expanse.MEDIUM);
btn.onClick(this::onButtonPush);
}
private void onButtonPush(ButtonClickEvent buttonClickEvent) {
App.msgbox("Hello World!");
}
}
The result is a modern, responsive HTML5 Web App.
- If not done yet, install BBj and the BBj DWCJ Plug-In.
- Download the .jar file from the releases of this project.
- In the DWCJ Plug-In's configure-Screen, add the .jar to the classpath.
- Push the launch button.
- Clone this repository
- Point your IDE to the home directory
- Adjust your settings.xml or the pom.xml to point to the copy on your disc, most likely /plugins/DWCJ/lib/dwc-xxxxx.jar
- Reload maven and build the jar
- Go to the DWCJ Plug-In configure screen and add the jar file (or the class bin folder) to the classpath
- enter samples.HelloWorldJava into the "Class" entry
- Click the "launch" button to see if it works