• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Marco Ferrè
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • 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: 56600
172
  • Mark post as helpful
  • send pies
  • 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
  • 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: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the date formatter for reading the date or displaying it?
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!