3

I want my program to terminate itself once the movie played has ended, using system.exit(0).

is there a way of doing that?

I dont want to use Timer.

Itzik984
  • 15,968
  • 28
  • 69
  • 107
  • 1
    Got it! player.addControllerListener(new ControllerListener() { public void controllerUpdate(ControllerEvent e) { if (e instanceof EndOfMediaEvent) { System.exit(0); } } } – Itzik984 Jan 16 '11 at 23:47
  • Would you mind posting your answer below so we can get this off the Unanswered list? Thank you. – Bill the Lizard May 22 '11 at 00:37

2 Answers2

0

The OP posted this answer as a comment.

 player.addControllerListener(new ControllerListener() {
     public void controllerUpdate(ControllerEvent e) { 
        if (e instanceof EndOfMediaEvent) { 
            System.exit(0); 
        }
     }
 }
Tim Williscroft
  • 3,705
  • 24
  • 37
0

Got it!

    player.addControllerListener(new ControllerListener()

    { 

      public void controllerUpdate(ControllerEvent e) 

      {   

      if (e instanceof EndOfMediaEvent) 

        {   

        System.exit(0); 

        }

      } 

    } 
Itzik984
  • 15,968
  • 28
  • 69
  • 107