• 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

Showing titles in ListView by selected date

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
I'm trying to write a program, that display list of movies that are aviliable in selected date in DatePicker. I'm adding movie showing date by another DatePicker, and it's working well(when i choose showing day, it saves, so I can see it again when i want to edit details). But I have a problem displaying titles by selected date. I was trying to do it by adding before setting titles in list, but it didn't seem to work. (showingDate is choosen date, and emissionDay is saved date for movies).
Can you help me, how I have to write part of code that check, if choosen and saved date are the same and show me right titles in list?
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what kind of data you're trying to compare with that code, but you should normally use the == operator only to compare primitive values. To compare two objects for equality you should use the equals() method. Like this:

 
Kuba Parys
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right, C++ habbit. But when I use equals(), i get NullPointerException..
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post an mcve
 
reply
    Bookmark Topic Watch Topic
  • New Topic