Search code examples
java-melwuitlwuit-resource-editor

LWUIT, How to create a custom label for form title


I want to know how to create a label that contains two icons, one on each side and set it as the title bar for the form element (LWUIT widgets).

enter image description here


Solution

  • Form has a function to get a titleArea then you can put some components what you want.

    Form f = new Form();
    Container c = f.getTitleArea();
    Label iconLabel1 = new Label("leftIcon");//using Image
    Label iconLabel2 = new Label("rightIcon");//using Image
    c.addComponent(BorderLayout.WEST, iconLabel1);
    c.addComponent(BorderLayout.EAST, iconLabel2);