FileDocCategorySizeDatePackage
BasicSwingQTPlayer.javaAPI DocExample2185Wed Nov 10 12:37:32 GMT 2004com.oreilly.qtjnotebook.ch02

BasicSwingQTPlayer

public class BasicSwingQTPlayer extends JFrame

Fields Summary
Constructors Summary
public BasicSwingQTPlayer(Movie m)

        super ("Basic Swing QT Player");
        MoviePlayer mp = new MoviePlayer (m);
        QTJComponent qc = QTFactory.makeQTJComponent (mp);
        JComponent jc = qc.asJComponent();
        getContentPane().add (jc);
        pack();
    
Methods Summary
public static voidmain(java.lang.String[] args)

        try {
            QTSessionCheck.check();
            QTFile file =
                QTFile.standardGetFilePreview (QTFile.kStandardQTFileTypes);
            OpenMovieFile omFile = OpenMovieFile.asRead (file);
            Movie m = Movie.fromFile (omFile);
            JFrame f = new BasicSwingQTPlayer (m);
            f.pack();
            f.setVisible(true);
            m.start();
        } catch (Exception e) {
            e.printStackTrace();
        }