I made a JDesktopPane with 20 JInternalFrames. However, when I iconify all of them, I can't scroll through them (left to right)
import javax.swing.*;
import java.awt.*;
class Untitled {
public static JDesktopPane desk;
public static JFrame f;
public static void main(String[] args) {
f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
f.setSize(1000,1000);
desk = new JDesktopPane();
f.add(desk);
f.setContentPane(desk);
f.setSize(1200,800);
f.setSize(1201,801);
for(int i = 0; i < 10; i++){
JInternalFrame j = new JInternalFrame("test",true,true,true,true);
desk.add(j);
j.setVisible(true);
j.setSize(300,500);
}
for(int a = 0; a < 10; a++){
JInternalFrame j = new JInternalFrame("test2",true,true,true,true);
desk.add(j);
j.setVisible(true);
j.setSize(300,500);
}
}
}
Is there any way I can, for example, iconify the JInternalFrames into a JScrollPane, so that I can scroll through them?