Java 3D to 2D applet problem
Hi, hopefully this is a simple problem for someone to help me solve.
I basically have a java applet that displays an interactive layout of a house that you can extend walls and such.
I have it so that you can click on a button that will call my applet3D class and that will display, in the same applet window, a 3D version of the layout of the house.
When I display the 3D version, I have my panels that hold the buttons (from the 2D applet) set as .setVisible(false); because for some reason, instead of displaying the 3D over the initial 2D layout, it displays it over the graphics but under the panels.
so after hiding the panels, I have the 3D display and a button that sends the viewer back to the initial 2D layout.
this is when the problem starts. What I initially did was give a simple:
for(int l=0; l<comboBoxes.length; l++)
for(int k=0; k<actionBt.length; k++)
for the actionEvent of the button. So I just remove everything of the applet3D class and re-add the Buttons and ComboBoxes back to the 2D Applet. and then I have a repaint at the end, to redraw my 2D layout.
The result, however, is my repaint working, and I can see my 2D layout, but my panels, buttons, and combo boxes are gone. It seems that the applet3D.removeAll(); has removed everything with it, including what I believe to be the rootpane that holds the panels. I'm not so sure though, but what i do know is that I cannot seem to add panels, buttons, or anything of the sort after that removeAll is called. I'm not sure why the applet3D's removeAll should affect the 2Dapplet's panels.
It's weird, because back in 2003, I did something very similar to this, with basically the same coding, just a bit messier. The java compiler was a bit old though, but it worked fine back then. I'm wondering if the errors I'm experiencing has to do with the change in the updates of the Java compilers.
Sorry if I did not explain my problem too clearly. I'm not very very experienced with programming.
Last Post: 03-21-2007, 04:28 PM
By sportacus in forum Java
Last Post: 11-28-2005, 04:39 AM
By Paul McCaffery in forum Java
Last Post: 11-21-2002, 06:24 PM
By Suraj Silva in forum Java
Last Post: 03-15-2002, 12:02 PM
By Mike Buchanan in forum Java
Last Post: 04-12-2000, 10:53 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL