Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Refreshing frames

Thread view: 
torchestra@gmail.com - 07 Oct 2005 22:47 GMT
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();
}

(...)
Monique Y. Mudama - 07 Oct 2005 23:07 GMT
> 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) +
[quoted text clipped - 7 lines]
>     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.

Signature

monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

Roedy Green - 08 Oct 2005 09:36 GMT
>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.