int min = 10 , sec = 60; JLabel time; JPanel main; JFrame mainfrm; JButton click; //-------------------------------------- public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null,"Ok"); try { for(int i = min ; i >0 ; i--) { for (int j = sec; j > 0; j--) { time.setText(i+":"+j);
System.out.println(i+":"+j); Thread.sleep(1000); } } } catch(Exception e1) { System.out.println(e1); }
}
Q :- In upper code I have create a small timer code in that I can't able to change the lable value at a run time in to the form ????
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 318
تاريخ: دوشنبه
11 مرداد
1395 ساعت: 2:39