If u are passing the exception to the calling method, which u are
doing by adding throws clause, in the calling method(which is probably
your main method) u also need to have something like try{Reproducir();}
catch(QTException qte){//exception handeling code} or u must add the
throws clause to the main method also(which is actly not recommanded
since that means to pass the exception further on and main is at the
buttom of the stack). (However, after how your code looks, i am not
sure u need throws clause for Reproducir() method)

On Jun 12, 11:01 pm, Rogelio <[email protected]> wrote:
> Well, I'm trying to make a music player, so using NetBeans I'm using
> this:
>
> public void Reproducir() throws QTException
>     {
>         File f = new File(String.valueOf(open.getSelectedFile()));
>         try
>         {
>             QTSession.open();
>             OpenMovieFile omf = OpenMovieFile.asRead(new QTFile(f));
>             Movie m = Movie.fromFile(omf);
>             Component c = QTFactory.makeQTComponent(m).asComponent();
>             add(c);
>             m.start();
>         }
>         catch(Exception e)
>         {
>             JOptionPane.showMessageDialog(null,"No se pudo abrir el
> archivo");
>             QTSession.close();
>         }
>     }
>
> Then using actionperformed on a JFileChooser:
>
>         Reproducir();
>         Open.setVisible(false); //hides the filechooser frame
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to