SWTML (SWT Markup Language)
SWTML is XML driven GUI building Java library for SWT (Standard Widget Toolkit).
Features:
- Separation of UI with application logic,
- Build native looking application with SWT
- Supports all widgets/layouts of SWT
- Easy to use XML syntax, all setter method of Widgets are supported as XML attribute
- Attach SWT's Event Listener to widgets in XML
- Define common resources like images, Font etc. and used them across widgets.
- Easy and direct access to rendered Objects in application.
- Flexible widget's hierarchy in XML. Create full application structure or just a small widget in XML.
- Dynamic XML loading and parsing supported. Create SWTML widgets on the fly in your application.
Information:
- Downloads : Download the latest version of SWTML library.
-
Widgets Gallery : Browse supported SWTML widgets.
-
Application Showcase : SWT Applications built using SWTML. Code provided here to understand the concepts of SWTML. Use at your own discretion.
-
SWTML Templates :
Ready to use UI templates to kick-start your application.
Hello World example:
- Download the SWTML and dependent jars and add to application's classpath.
- Create a XML file with SWT Shell and a Label.
hello-world.xml :
<?xml version="1.0" encoding="UTF-8"?>
<shell text="My Application" style="SWT.SHELL_TRIM">
<fill-layout/>
<label text="Hello World" />
</shell>
-
Use com.sheelapps.swtml.SWTParser to parse hello-world.xml to create Shell widget.
Display display = Display.
getDefault();
try {
com.
sheelapps.
swtml.
SWTParser parser =
new com.
sheelapps.
swtml.
SWTParser();
Shell shell =
(Shell
) parser.
doParse(HelloWorld.
class.
getResourceAsStream("/com/sheelapps/swtml/examples/hello-world.xml"));
shell.
open();
while (!shell.
isDisposed()) {
if (!display.
readAndDispatch())
display.
sleep();
}
display.
dispose();
} catch (Exception e
) {
e.
printStackTrace();
}
SWTML is free for non-commercial use.
SWTML Widgets