Hello, Andy.

     I assume you're trying to run the program as an
application.  My fellow coders and I have had a few
problems using MainFrame, so instead we just extend
java.awt.Frame; then, on initialization:

   setLayout(new BorderLayout());
   add("Center", canvas3D);
   setSize(400, 400);

and, most importantly,

   addWindowListener(new
java.awt.event.WindowAdapter()
   {
      public void
windowClosing(java.awt.event.WindowEvent e)
      {
         dispose();
         System.exit(0);
      }
   });

     I haven't checked the archives for this problem
(maybe I should), usually I just try to find
workarounds.

     Hope this helps.

                              Cromwell

--- Andy Tay <[EMAIL PROTECTED]> wrote:
> I try to set my MainFrame to be 400, 400 and even
> 500, 500.. But when i run the program.. It always
> give me a standard size which I couldn't change it.
>
>
> Andy
>
>
> public void init() {
>
>   setLayout(new BorderLayout());
>         Canvas3D canvas3D = new Canvas3D(null);
>         add("Center", canvas3D);
>
>         BranchGroup scene = createSceneGraph();
>
>         // SimpleUniverse is a Convenience Utility
> class
>         SimpleUniverse simpleU = new
> SimpleUniverse(canvas3D);
>
>  // This will move the ViewPlatform back a bit so
> the
>  // objects in the scene can be viewed.
>
>
simpleU.getViewingPlatform().setNominalViewingTransform();
>
>         simpleU.addBranchGraph(scene);
>     } // end of FinalProject constructor
>
>     //  The following allows this to be run as an
> application
>     //  as well as an applet
>
>     public static void main(String[] args) {
>         //Frame frame =
>         new MainFrame(new FinalProject(), 400, 400);
>     } // end of main method of FinalProject
>


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.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".

Reply via email to