Refreshing frames

Discussion in 'Java' started by torchestra@gmail.com, Oct 7, 2005.

  1. Guest

    I am using Quicktime for Java and have placed a movie in a frame. I
    would like to replace the movie with another movie when it finish
    playing. For this I use the triggerAtStop in the quicktime.std.clocks
    class. My problem is that the new movie is placed bellow the first
    movie in the frame and do not replace it.


    (Some of the code - the programme load files, L1M1.mp4, L1M2,mp4 etc.
    where the numbers in the file name are generated from variables.


    (...)

    class MyQTCallback extends ExtremesCallBack {
    public MyQTCallback (Movie m) throws QTException {
    super (m.getTimeBase(), StdQTConstants.triggerAtStop);
    callMeWhen();
    }


    public void execute () {
    try {
    M = M+1;
    NewMovie();

    } catch (QTException qte) {
    qte.printStackTrace();
    }
    }


    public static void main (String [] Args) {
    try {
    QTSessionCheck.check();
    System.out.println(filpath+filnavn);
    filnavn = "L"+ Integer.toString(L) + "M" +

    Integer.toString(M) + ".mp4";
    QTFile file = new QTFile( new File(filpath,
    filnavn));
    OpenMovieFile omFile =
    OpenMovieFile.asRead((QTFile) file);
    Movie m = Movie.fromFile(omFile);
    Frame f = new BasicQTSherlock (m);
    f.pack();
    f.setVisible(true);
    m.start();

    } catch (Exception e) {
    e.printStackTrace();
    }
    }


    public void NewMovie () throws QTException {
    filnavn = "L"+ Integer.toString(L) + "M" + Integer.toString(M) +
    ".mp4";
    QTFile file = new QTFile( new File(filpath, filnavn));
    OpenMovieFile omFile = OpenMovieFile.asRead((QTFile) file);
    Movie m = Movie.fromFile(omFile);
    QTComponent qc= QTFactory.makeQTComponent(m);
    Component c = qc.asComponent();
    add (c,BorderLayout.CENTER);
    m.start();
    }

    (...)
     
    , Oct 7, 2005
    #1
    1. Advertising

  2. On 2005-10-07, penned:
    > I am using Quicktime for Java and have placed a movie in a frame. I
    > would like to replace the movie with another movie when it finish
    > playing. For this I use the triggerAtStop in the quicktime.std.clocks
    > class. My problem is that the new movie is placed bellow the first
    > movie in the frame and do not replace it.
    >


    [snip]

    >
    > public void NewMovie () throws QTException {
    > filnavn = "L"+ Integer.toString(L) + "M" + Integer.toString(M) +
    > ".mp4";
    > QTFile file = new QTFile( new File(filpath, filnavn));
    > OpenMovieFile omFile = OpenMovieFile.asRead((QTFile) file);
    > Movie m = Movie.fromFile(omFile);
    > QTComponent qc= QTFactory.makeQTComponent(m);
    > Component c = qc.asComponent();
    > add (c,BorderLayout.CENTER);
    > m.start();
    > }


    I'm not really familiar with this QT stuff, but I didn't see a
    remove() anywhere. At a very rough glance, it looks like you keep
    adding components, but you never take the old ones away.

    --
    monique

    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html
     
    Monique Y. Mudama, Oct 7, 2005
    #2
    1. Advertising

  3. Roedy Green Guest

    On 7 Oct 2005 14:47:15 -0700, wrote or quoted :

    >Movie m = Movie.fromFile(omFile);
    > Frame f = new BasicQTSherlock (m);
    > f.pack();
    > f.setVisible(true);


    It looks as though you create a whole new frame for each movie. If
    you want that frame to disappear, you will need a f.dispose()

    I have never heard of this API. Look for some close, dispose, remove
    methods at the various levels that you call when the movie is done.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 8, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jules
    Replies:
    7
    Views:
    4,728
    Robert Frost-Bridges
    Sep 6, 2004
  2. Jim Hudd

    Refreshing a frames page

    Jim Hudd, Sep 25, 2004, in forum: HTML
    Replies:
    3
    Views:
    421
    Dan Abrey
    Sep 27, 2004
  3. Nav

    refreshing frames

    Nav, Feb 23, 2006, in forum: HTML
    Replies:
    1
    Views:
    588
    Roy Schestowitz
    Feb 23, 2006
  4. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    470
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    194
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page