Jennifer Lopez knows how Leslie Rodgers feels.
The actress-singer, 43, who plays the character in the crime thriller Parker, tells PEOPLE that when she and Marc Anthony began divorce proceedings, she "felt like my whole world had fallen apart."
Lopez, who was just going through the breakup at the time she began filming the movie, says she related to her character.
"Leslie had just gone through her own divorce," she explains. "It's a bad time in her life."
But Lopez isn't the only one who spotted similarities between herself and the woman she was hired to play.
"[Director Taylor Hackford] called me and he was like, 'I have a part for you,' " Lopez recalls. "And I was like, 'Really? Oh, cool. What is it?' And he was like, 'You know, I've been watching you on American Idol, and I love that girl. I love her, but that's not who I want. But it made me think something in this character. … When I see you there, I think you never give up. You keep going.' "
Lopez, who is now happy in the arms of boyfriend Casper Smart, notes the deeper similarities as well.
"Leslie, even when she's down on the bottom and everything is bad at that time, she won't give up," she says. "She still has a glimmer of hope."