final JDesktopPane desktopPane = new JDesktopPane();
final JInternalFrame[] frames = new JInternalFrame[12];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
SampleInternalFrame internalFrame = new SampleInternalFrame();
internalFrame.getRootPane().putClientProperty(
SubstanceLookAndFeel.SKIN_PROPERTY,
skinGrid[i][j]);
SwingUtilities.updateComponentTreeUI(internalFrame);
frames[i * 3 + j] = internalFrame;
desktopPane.add(internalFrame);
internalFrame.setVisible(true);
}
}
desktopPane.addComponentListener(new ComponentAdapter() {
@Override