Panel 3

Let's look at the code of the form in pane2 so you'll get an idea of how to assemble forms.

	public GuiDemoForm(String name, Translator translator, WindowControl wControl) {
		super(name);
		setTranslator(translator);
		
		// title
		title = new TitleElement("guidemo.form.title");
		addFormElement("title", title);
		
		// text
		text = new TextElement("guidemo.form.text", 50);
		text.setMandatory(true);
		text.setExample("You may give examples for any form field, whcih is shown below the field.");
		text.setPopupData(new PopupData("textarea", "popup", "guidemo.gorm.popup", 100, 100));
		addFormElement("text", text);
		
		// readonly
		readonly = new TextElement("guidemo.form.readonly", 10);
		readonly.setValue("readonly");
		readonly.setReadOnly(true);
		addFormElement("readonly", readonly);

		// date chooser
		date = new TextElement("guidemo.form.date", 10);
		date.setDateChooserDateFormat("%d.%m.%Y");
		date.setUseDateChooser(true);
		date.setExample("Format: dd.mm.yyyy [e.g. 17.04.2007]");
		addFormElement("date", date);
		
		// link
		link = new LinkElement("guidemo.form.link", "http://www.google.com/", "Link to google.com");
		addFormElement("link", link);
		
		// radio
		String[] keys = new String[] { "1", "2", "3", "4" };
		String[] lables = new String[] { "red", "green", "blue", "yellow" };
		radio = new StaticSingleSelectionElement("guidemo.form.radio", keys, lables);
		addFormElement("radio", radio);
		
		// checkbox
		String[] keys2 = new String[] { "1", "2", "3", "4" };
		String[] lables2 = new String[] { "square", "circle", "rectangle", "triangle" };
		checkbox = new StaticMultipleSelectionElement("guidemo.form.checkbox", keys2, lables2, true);
		addFormElement("checkbox", checkbox);
		
		spacer = new SpacerElement();
		addFormElement("spacer", spacer);
		
		textarea = new TextAreaElement("guidemo.form.textarea", 10, 100);
		addFormElement("textarea", textarea);
		
		// submit / cancel keys
		addSubmitKey("submit");
		addCancelKey("cancel");
	}