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

java.util.gregoriancalendar time= arefieldsset=false areallfieldsset=true

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i have in AbstractTableModel this case:

but when i want to return in the table (getValueAt --> columnIndex == 4 and columnIndex == 5), i can find only:
java.util.gregoriancalendar time= arefieldsset=false areallfieldsset=true
who can help me to see in the row only the time in format HH:mm:ss?
Thanks
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had to break one of your lines because it was too long. Look at line 22/23 so you can see how to do it.

I suggest, now that Java8 is here, you stop using GregorianCalendar. Read about the new classes in the Java Tutorials.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that is all you are getting by printing a Calendar object? Have you tried the %T tags and printf? Look in the Formatter class documentation.
 
Marco Ferrè
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the problems are in 31-32 and 34-35....
In the table i can see only this error!
i use this formatter for date:
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss", Locale.ITALY);
but i want show in this row of my table only a specified time:
for example ( 8:30:00)
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the date formatter for reading the date or displaying it?
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you write some dates and Calendar objects at the command line and try different ways to display them. Find out about %T as I said yesterday.
 
reply
    Bookmark Topic Watch Topic
  • New Topic