I have provided you with a sample of coding that will create the desktop and internal frames.
Code:
desktop = new JDesktopPane();
createFrame();
setContentPane(desktop);
...
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
...
protected void createFrame() {
MyInternalFrame frame = new MyInternalFrame();
frame.setVisible(true);
desktop.add(frame);
try {
frame.setSelected(true);
} catch (java.beans.PropertyVetoException e) {}
}
static int openFrameCount = 0;
static final int xOffset = 40, yOffset = 40;
public MyInternalFrame() {
super("Document #" + (++openFrameCount),
true,
true,
true,
true);
...
setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
}
Bookmarks