I want to create a function which takes two arguments
The function creates LWUIT Combobox with these two parameters and returns a ComboBox varialble...
I have written following code ...
public void createComboxBox(String recStoreName,String [] values){
comboBox = new ComboBox(recStoreName, values);
surveyForm.addComponent(comboBox);
}
//create a form and set its title
Form f = new Form("Simple ComboBox");
//set layout manager for the form
//f.setLayout(new FlowLayout());
//set form background colour
f.getStyle().setBgColor(0xd5fff9);
.
.
.
The first two lines of code are quite self-explanatory and should be familiar to AWT/Swing developers. The third line sets the background color attribute for the form.
The combo box is also instantiated in a similar manner:
// Create a set of items
String[] items = { "Red", "Blue", "Green", "Yellow" };
//create a combobox with String[] items
ComboBox combobox = new ComboBox(items);
Resource
Also See