el salam 3alekom
can any one help me ,
How to use the check box in the form in JAVAME
thx in advanced
el salam 3alekom
can any one help me ,
How to use the check box in the form in JAVAME
thx in advanced
هذا مثال:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class CheckBoxes extends MIDlet implements CommandListener
{
private Display display;
private Form form;
private Command exit;
private Command process;
private ChoiceGroup movies;
private int movieIndex;
public CheckBoxes()
{
display = Display.getDisplay(this);
movies = new ChoiceGroup("Select Movies You Like to See",
Choice.MULTIPLE);
movies.append("Action", null);
movies.append("Romance", null);
movies.append("Comedy", null);
movies.append("Horror", null);
exit = new Command("Exit", Command.EXIT, 1);
process = new Command("Process", Command.SCREEN,2);
form = new Form("Movies");
movieIndex = form.append(movies);
form.addCommand(exit);
form.addCommand(process);
form.setCommandListener(this);
}
public void startApp()
{
display.setCurrent(form);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command command, Displayable displayable)
{
if (command == process)
{
boolean picks[] = new boolean[movies.size()];
StringItem message[] = new StringItem[movies.size()];
movies.getSelectedFlags(picks);
for (int x = 0; x < picks.length; x++)
{
if (picks[x])
{
message[x] = new StringItem("",movies.getString(x)+"\n");
form.append(message[x]);
}
}
form.delete(movieIndex);
form.removeCommand(process);
}
else if (command == exit)
{
destroyApp(false);
notifyDestroyed();
}
}
}thx eng.mo7amed
but can I make choices element names change from the code
for example :
movies.append("Action", null);
movies.append("Romance", null);
can I put (action)or (romance) as variables and change them according to my code
choiceGroup.delete(1); choiceGroup.insert(1, "Hello", null);
حاولي بالكود اكثر لم اجربه
Thx eng.Mo7amed
I will try it
أرجو في المره القادمه ان تستخدمي اللغه العربيه. وشكرا...
الأخ الكريم/الأخت الكريمة
السلام عليكم ورحمة الله وبركاته
مرحباً بكم في منتدى الفريق العربي للبرمجة
تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات .
قواعد طرح المشاركات
شاكرين لكم حُسن تعاونكم
تم تعديل هذه المشاركة بواسطة مهدي حجازي في 5 يوليو 2010 في 09:07