try calling stopRenderer() on your canvas3d when the start game button is
pressed.

concerning your awt/swing question, you are right: all swing-components but
JFrame and JDialog are lightweight. yes you can mix lightweight and
heavyweight in your app, and i don't think using swing instead of awt would
have a major impact on performance (because when you don't use the GUI
controls, they do not consume processing time).

the only thing you have to watch for when using lightweight components and a
canvas3d is that you cannot display lightweight components *in front* of the
canvas in the same Window/Frame/JFrame, because they will be overwritten by
the canvas contents. if you want to display something in front of the
canvas3d, like a popup menu, you have to use a heavyweight component.

however, if a component is to the side of the canvas3d, it can be
heavyweight or lightweight.

in different frames (AWT-Frames and/or JFrames) you can freely mix
lightweight/heavyweight and awt/swing components.

-- julian


-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Anders Breivik
Sent: Saturday, March 04, 2000 2:56 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] AWT or Swing, User Interface,Performance?


Hello!

Thanks for previous feedback.

I couldn't see that my last email reached the list so I'm writing again.

Could anyone help me with the following: In my game I have an option user
interface which has a small canvas3D in some of the GridBagLayout cells. It
is just a simple animation of a rotating object - Just to make it look
pretty. When the "Start Game" botton is pressed the real game starts by
removing all components in the Frame and adding the canvas3D which
represents the actual game.

The problem:
The java3D program which gives the simple animation in the options user
interface makes the speed of the game decrease. In fact, it almost crashes
after the start game button is pressed. When I remove the animation from the
options section and press start - the game runs fine.
I've tried disposing the option user interface (with the animation) before
launching the game, but this doesn't help. When using the animation in the
options section it somehow consumes a loot of
processing power/memory and makes the game halt.

What am I doing wrong? I need to somehow "kill" the animation program
before calling the class which makes the game. Does anyone know how to work
around this?

One more thing, I'm currently using AWT, but would like to use Swing.
Are there any differences in Java3D perfomance when comparing these two
methods?
I've had some problems integrating Swing with Java3D (the
lightweight-heavyweight issue). I've read that JFrame is a heavy weight
component and that most other J-components are lightweight(?)
If I add lightweight components (JBottons,JTextFields etc.) to a heavyweight
JFrame and add the canvas3D to a new JFrame, will these two JFrames mix??
Or do I have to convert lightweight components to heavyweight?


Well, hope anyone can give me some ideas, any feedback is greatly
appreciated.

Anders.







______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to