Mailing Lists: Apple Mailing Lists

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

QTJava with swing (was Re: is it just me?)



On 2002.01.22, at 03:41, Rolf Howarth wrote:

- Finally, even though QuickTime canvases are heavyweight (peered) AWT
components, with a bit of care you CAN combine them successfully with
Swing. You won't be able to float other Swing components over the top of
a QTCanvas, as it will tend to punch a hole straight through all the
layers, but as long as the canvas is on top and you're not overambitious
with the control you want over event processing you shouldn't have too
many problems.


How timely! This touches on a topic I was just trying to deal with. I am
a Java novice and just looking into QTJava as a possible solution for
making some graphics conversion and manipulation tools that will work
for both our Mac-based and Wintel-based designers. I just got started
with some of the QTJava sample code.

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 don't know enough yet about how events get passed among components
yet, so I'm looking for advice on how to deal with a QTCanvas and
MovieController within swing, or advice on if/why I should abandon swing
and go with awt when using QTJ. The main reasons I am using swing are 1)
it's what I know how to do now, 2) I believe it benefits from HW
acceleration, which awt does not, 3) my understanding is that it is
easier to setup UIs using swing than just awt.

Any advice appreciated,


Colin.




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.