Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

Version 1 Aktuelle »


Below you find a reference implementation for a JAXFront Plugin. This plugin just displays a label, a text area with 4 rows, a certain textfont and a fat green border around the control.
com.jaxfront.demo.api.OwnPlugin
public class OwnPlugin extends AbstractSimpleVisualizer {
private JTextArea _textArea;
public String getLabelText() {
return "Simple Plugin Example";
}
public String getText() {
if (_textArea != null) return _textArea.getText();
return null;
}
public void populateView() {
if (getModel() != null && _textArea != null) {
String value = ((SimpleType)getModel()).getValue();
if (value != null) {
_textArea.setText(value);
}
}
}
protected JComponent createEditorComponent() {
_textArea = new JTextArea();
_textArea.setForeground(Color.blue);
setBorder(BorderFactory.createMatteBorder(20,20,20,20,Color.GREEN));
_textArea.addFocusListener(this);
_textArea.setFont(new Font(null,1,20));
_textArea.setRows(4);
_textArea.setLineWrap(true);
_textArea.addFocusListener(this);
_firstFocusableComponent = _textArea;
return _textArea;
}
}


  • Keine Stichwörter