Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QTJ with swing (was Re: Is it just me?)



Thanks for the tip, Rolf. Worked like a charm.

In the future though, I will have need to have 2 movies in the window (for side by side comparison), and would like to have some semi-obvious way of having the user change focus easily between the two, so that the user can jump the focus back and forth (with maybe a mouse-click or the tab key) and single-step either of the movies. Any idea where I might want to jump into the event passing hierarchy to grab these events and muck about with them?

One more swing/QT related issue has come up with this program. In the Aqua L&F, the JMenus in my application will still look ok even when pulled down over the top of the movie. This was unexpected, since the docs say the QTCanvas is a heavyweight component and thus will get drawn on top of any lightweight components like a swing menu. I was surprised that the JMenu actually looked ok, transparently overlapping the movie's QTCanvas. But then when I tried forcing the "multiplatform" java L&F with

UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName())
;

I saw that my pull down menus did get lost "behind" the QTCanvas as advertised. This makes me think that mixing swing and QTJava might be a problem for apps that need to work on Windows as well.

Anyone have any suggestions for how to deal with the swing interface component vs QTCanvas issue for apps that will run on windows as well?

Thanks,

Colin


On 2002.01.22, at 18:18, Rolf Howarth wrote:

At 13:42 +0900 22/1/02, Colin Mack wrote:

The sample program PlayMovie lets you open a movie file and play it with the standard QT controller visible. It works just fine as is, using a main class that extends Frame. Since what little java knowledge I have comes from swing-oriented book, I tried moving the guts of PlayMovie over to a swing-based setup, using my own groovy custom layout in a JFrame-based main class. Works almost as it should, but I lose the ability to step frame-by-frame using just the arrow keys on the keyboard (this works in the original PlayMovie). I have set setKeysEnabled(true) for the MovieController but it doesn't seem to be enough.

I had similar problems with the keyboard control. Try calling requestFocus() on your QTCanvas after laying out and showing your frame.

-Rolf
-- Rolf Howarth, Square Box Systems Ltd, Stratford-upon-Avon UK.


References: 
 >Re: QTJ with swing (was Re: Is it just me?) (From: Rolf Howarth <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.