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

A code error in handling a button

مغلق
بدأه microsmart1 في 12 نوفمبر 2006 · 1 رد · 541 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

when i write the code as follows

class MyInner implements ActionListener 
{ 


public void actionPerformed(ActionEvent e) 
{ 
if(txt1.getText().equals("") && txt2.getText().equals(""))//check listener 
{ 

if (e.getActionCommand().equals("Result"))//button listener 
{ 


//the required process to executed 


int random= ((int)(50*Math.random()))+50; 
txt3.setText(random+"%"); 

} 
} 
} 

}

it does not print any thing

what is missing?

although i have called addactionlistener

what is the problem?

#2

أعتقد أن هذه الجمل يجب أن تكون بين أقواس

txt1.getText().equals("") 

txt2.getText().equals("")

هذا الموضوع مغلق.

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