use of javax.swing.DesktopManager in project GCViewer by chewiebug.
the class Arrange method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
for (int i = 0; i < frames.length; i++) {
final JInternalFrame frame = frames[i];
desktopManager.deiconifyFrame(frame);
try {
frame.setMaximum(false);
} catch (PropertyVetoException e1) {
e1.printStackTrace();
}
final int height = gcViewer.getDesktopPane().getHeight() / frames.length;
desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
}
}
Aggregations