public Form getSupportMe() { if (frmSupportMe == null) { // --------------------------------------------- // Form f = ... frmSupportMe = new Form("Support Me"); frmSupportMe.setLayout(new BorderLayout()); Image bimage = null; try { bimage = Image.createImage("/images/metaLabSmall.png"); } catch (IOException ex) { ex.printStackTrace(); } Label bottomText = new Label(bimage); bottomText.setAlignment(Component.CENTER); bottomText.setText("Our Logo"); bottomText.setTextPosition(Component.BOTTOM); Container buttonBar = new Container(new BoxLayout(BoxLayout.X_AXIS)); buttonBar.addComponent(new Button("Add")); buttonBar.addComponent(new Button("Remove")); buttonBar.addComponent(new Button("Edit")); buttonBar.addComponent(new Button("Send")); buttonBar.addComponent(new Button("Exit")); frmSupportMe.addComponent(BorderLayout.CENTER, bottomText); frmSupportMe.addComponent(BorderLayout.SOUTH, buttonBar); frmSupportMe.addCommand(mBackCommand); frmSupportMe.addCommandListener(this); // Use setCommandListener() with LWUIT 1.3 or earlier. } return frmSupportMe; }
/* public PIMBrowser getPimToDo() { if (pimToDo == null) { // write pre-init user code here pimToDo = new PIMBrowser(getDisplay(), PIM.TODO_LIST); pimToDo.setTitle("To Do List"); pimToDo.addCommand(PIMBrowser.SELECT_PIM_ITEM); pimToDo.addCommand(getBackCommand5()); pimToDo.setCommandListener(this); // write post-init user code here } return pimToDo; } */ public Form fullgetToDoList() { Form f = new Form("To Do List"); if (frmToDoList == null) { f.setLayout(new BoxLayout(BoxLayout.Y_AXIS)); toDoList = new List(); pim = PIM.getInstance(); f.addComponent(toDoList); final TextArea searchField = TextField.create(); f.addComponent(searchField); Button searchButton = new Button("Search"); searchButton.setPreferredW(f.getWidth() / 2 - 5); searchButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { populateToDoList(searchField.getText()); } }); Button clearButton = new Button("Clear"); clearButton.setPreferredW(f.getWidth() / 2 - 5); clearButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { searchField.setText(""); populateToDoList(""); } }); Container buttonContainer = new Container(); buttonContainer.setLayout(new BorderLayout()); buttonContainer.addComponent(BorderLayout.WEST, searchButton); buttonContainer.addComponent(BorderLayout.EAST, clearButton); f.addComponent(buttonContainer); populateToDoList(searchField.getText()); f.addCommand(mBackCommand); f.addCommandListener(this); // Use setCommandListener() with LWUIT 1.3 or earlier. f.setTransitionInAnimator(Transition3D.createCube(300, false)); f.setTransitionOutAnimator(Transition3D.createCube(300, true)); } return f; }