Hi Jimmy,

I was probably too quick when I thought that I found the solution.
I was able to add and see my Swing components, but now I have problem
with BarMenu component. When I click on corresponding JMenuBar root
menu item (on MenuBar widget), it highlights, but I cannot see the
drop-down part of my menu and the menu does not accept mouse clicks.

Again, I can click on the "File" label in the MenuBar and it highlights,
but I cannot see the rest of the menu items. All of the event generation
happened in the Swing component area, so AWT should not change anything
(in theory). However, in practice it is quite different.

Do you have any ideas what to do?
Do you think it might be relevant to specific JDK like
Blackdown, Inprise, IBM, etc.?

Regards,

Jacob Nikom


Jacob Nikom wrote:
>
> Hi Jimmy,
>
> Thank you for your advice. I was encoureged by your explanation
> and was able to solve the problem. However, I think it is important
> to know WHICH heavyweight component should be used to add Swing
> component to it.
>
> You cannot use Frame, because you cannot add Window to Window. I used
> AWT Panel and it worked. I decided to write about it because almost
> all examples which I saw subclassed Applet and used special method
> MainFrame() to run the applet as application. I think it is quite
> inconvenient - to use Frame is much more common.
>
> Here is the code snippet:
>
> public class MyAxisApp extends Frame
> {
>   static Canvas3D canvas3D;
> ...........................
>  public static void main(String[] args)
>   {
>     Frame frame = new Frame();
>
>     frame.addWindowListener(new WindowAdapter()
>     {
>       public void windowClosing(WindowEvent event)
>       {
>         System.exit(0);
>       }
>     });
>
>     canvas3D = new Canvas3D(null);
>     canvas3D.setBounds(0, 0, 128, 128);
>     MyAxisApp MyAxisApp = new MyAxisApp();
>
>     DisplayImageJPanel displayImageJPanel = new DisplayImageJPanel(); //
> Swing component
>
>     int createImageFlag = displayImagePanel.CreateImage();
>
>     Panel contentPanel = new Panel();
>
>     contentPanel.add(displayImagePanel);
>
>     frame.add(canvas3D);
>     frame.add(contentPanel);
>     frame.setVisible(true);
>     frame.validate();
>   }
> }
>
> Regards,
>
> Jacob Nikom
>
> Jimmy Talbot wrote:
> >
> > Hi,
> >
> > > I am trying to work with Java3D and Swing on Linux. I was able to
> > > run some 3D programs but stuck when I tried to place JPanel and
> > > Canvas3D on the same Frame.
> >
> > I was faced with the same problem; You can put them in the same frame, but
> > you have to put your swing components in their own heavyweight object
> > which you then put in the same frame as the other heavyweight
> > objects. That seems to work pretty good for me. Please let me know if you
> > find a better solution :)
> >
> > Jimmy
> >
> > ===========================================================================
> > 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".

===========================================================================
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