embedding an applet into an applet? *child forms possible?*
im familiar with visual basic and im trying to build an online app using java..
the application will need multiple forms or windows to perform properly.. is there a way to do this? how can i have child forms inside a main form?
would i somehow create frames or dialoges with application content in them?
There are many ways to do this; e.g. your applet could be a JTabbedPane with your forms
as JPanels, or you could go for a BorderLayout where your forms are JPanels that you swap in the center.
What you choose depends on the look-and-feel you are going for.
"Child forms inside a main form", ... in Java that is LayoutManagers.
Last edited by sjalle; 06-13-2005 at 08:17 AM.
why thank you,
Originally Posted by sjalle
so i import the javax.swing.* package?
can i use anyone of the containers: jwindow, jdialog, jframe inside of the applet? how do i get it "JTabbedPaned" ? i want the windows like another applet but youre not able to move them outside of the parameter of the main applet! but i was hoping they would have functionality like closing and and miniizing
The applet is a panel descendant, in other words, a container. You can set your
applets layout to 1 row/1 column GridLayout. Then create and add a JTabbedPane to the applet.
The tabbedPane is a special container that allowa adding of several other containers
(JPanels) inside it. They appear as selectable tabs on top (thats the default) of
I think you are on the wrong track if you want to acieve application "behaviour" in a
web browser. The java applet is contained in a "sandbox" inside the browser and is
only allowed to do what the SecurityManager allows it to do, and I don't think
closing the browser or minimizing it are one of the allowed actions.
Apart from the window-operations the JPanel and The JApplet are very similar to the
JFrame, and you cannot add a frame inside another frame, unless its a JInternalFrame.
I have coded a base setup here for a MDi type applet. That allows for
minimizing windows inside the applet.
If you want to check it out (and copy the html) its here:
PS: you can delete the internal frame's close-button, its useless
Last edited by sjalle; 06-13-2005 at 07:51 PM.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center