الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

How To Stop This While-loop?

بدأه X0_soso_0X في 2 مارس 2009 · 0 رد · 358 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1

بســم الله الـرحمــن الرحيــم

السلام عليكــم ورحمـة الله وبركاتــة ،،

Hi guys,

could anyone help me with this problem??

I'm creating an application with the wireless toolkit. in the program, i have a do-while loop that containes a "Manager.playTone()". I want the sound to stop when the user clicks on the OK command.

the follwoing is the part of the code i'm talking about:

.

.

.

.

boolean cont= true;

.

.

.

.

private Form form_a;

.

.

.

.

form_a= new Form("Alarm");

form_a.addCommand(ok);

.

.

display.setCurrent(form_a);

form_a1.setCommandListener(this);

do{

try{

Manager.playTone(80,2000,100);

}

catch(MediaException me){}

}while(cont);

.

.

.

.

else if(label.equals("OK"))

{

display.setCurrent(form_main);

form_a.setCommandListener(this);

cont=false;

}

the problem i'm facing is, that the sound starts and never stops and the OK command doesn't appear at all in the screen ... does any body know what the problem is???

thank you

مواضيع مشابهة