• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Showing titles in ListView by selected date

 
Kuba Parys
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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?
 
Paul Clapham
Sheriff
Posts: 21558
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Right, C++ habbit. But when I use equals(), i get NullPointerException..
 
John Damien Smith
Ranch Hand
Posts: 296
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post an mcve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic