• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

J2ME Time Listner

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am developing a World clock application and displaying times of 4 locations at a time.

I am using J2ME Polish for my UI

My problem is i want the change the time of the currently displaying locations when the system's time changes that is for every minute.

Please suggest me an efficient approach.

I tried on method which is mentioned below.

I extended the ClockItem in J2ME Polish item and override the paintmethod() such that when ever the time changes in the current display, all the others can be changed.

But the problem was it was happening for every second which i feel is not correct and i am unable to hide the seconds field.
 
Saloon Keeper
Posts: 28321
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd call the system get time method on each of the intercepted paint calls. If the minutes digit has changed, repaint the other areas.
 
Ramkumar Subburaj
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply but how to display the time with seconds hidden.

Can you please help me
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I had a look at your method and seems ok
But to depend on UI component for time update can be an inaccurate approach.
J2ME polish is accurate with the painting based on thread timing and frame delay calculations.
But if the UI of the application increases then the delay of the UI updation might increase.
-----------------
So your time calculation shouldnt be depending on a UI element.
But it can be accurate if you use your own thread with a predetermined sleep time, wake up and check elapsed time, if its 1 min(as you might need) then update/do update/ else go sleep

--Syam Sathyan
(My Boss is a Jewish carpenter)
 
Liar, liar, pants on fire! refreshing plug:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic