• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Changing Text of JLabel Daynamically

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm working as programmer and found I don'r be able to change label name dynamically. reffer this code.

############################## CODE ################################
javax.swing.JLable lblday = new javax.swing.JLabel();
java.util.Calendar cal = java.util.Calendar.instace();//what so ever
////method to get Instance of Calendar
String day[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
lblday.setText(day[cal.DAY_OF_WEEK]);

#######################################################################
//It dint show Label on Frame Don't know why...
Plz, Send me reply on my hotmail id if you found solution related to this.
or If I done mistake in code.

thanks,
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lucky Indian,

Welcome to JavaRanch. Please look carefully at the official naming policy at Javaranch & reregister yourself with a proper first & last name. Please adhere to official naming policy & help maintain the decorum of the forum. The naming policy can be found at http://www.javaranch.com/name.jsp

Thanks,

Andrew
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
debugging 101:
System.out.println(cal.DAY_OF_WEEK);

> Plz, Send me reply on my hotmail id
post it here, read it here.
reply
    Bookmark Topic Watch Topic
  • New Topic