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.
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.
why thank you,
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
the tabbedPane.
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:
Bookmarks