93a94,98
> 		// do nothing if no frames to work with
> 		if (allFrames.length == 0) {
> 			return;
> 		}
> 
94a100
> 
114c120,123
< 	 * Tile all internal frames
---
> 	 * Tile all internal frames<br>
> 	 *
> 	 * @deprecated use tileFramesHorizontally() instead
> 	 *
116a126,129
> 		tileFramesHorizontally();
> 	}
> 
> 	public void tileFramesHorizontally() {
117a131,136
> 
> 		// do nothing if no frames to work with
> 		if (allFrames.length == 0) {
> 			return;
> 		}
> 
119d137
< 		int frameHeight = getBounds().height/allFrames.length;
120a139
> 		int frameHeight = getBounds().height/allFrames.length;
136a156,307
> 	public void tileFramesVertically() {
> 		java.awt.Component allFrames[] = getAllFrames();
> 
> 		// do nothing if no frames to work with
> 		if (allFrames.length == 0) {
> 			return;
> 		}
> 		manager.setNormalSize();
> 
> 		int frameWidth = getBounds().width/allFrames.length;
> 		int x = 0;
> 		for (int i = 0; i < allFrames.length; i++) {
> 			try {
> 				((JInternalFrame)allFrames[i]).setMaximum(false);
> 			}
> 			catch (PropertyVetoException e) {
> 				e.printStackTrace();
> 			}
> 
> 			allFrames[i].setBounds(x, 0, frameWidth, getBounds().height);
> 			x = x + frameWidth;
> 		}
> 
> 		checkDesktopSize();
> 	}
> 
> 	/**
> 	 * Arranges the frames as efficiently as possibly with preference for
> 	 * keeping vertical size maximal.<br>
> 	 *
> 	 */
> 	public void arrangeFramesVertically() {
> 		java.awt.Component allFrames[] = getAllFrames();
> 		// do nothing if no frames to work with
> 		if (allFrames.length == 0) {
> 			return;
> 		}
> 
> 		manager.setNormalSize();
> 
> 		int horFrames;
> 		int vertFrames;
> 
> 		vertFrames = (int)Math.floor(Math.sqrt(allFrames.length));
> 		horFrames = (int)Math.ceil(Math.sqrt(allFrames.length));
> 
> 		// first arrange the windows that have equal size
> 		int frameWidth = getBounds().width / horFrames;
> 		int frameHeight = getBounds().height / vertFrames;
> 		int x = 0;
> 		int y = 0;
> 		int frameIdx = 0;
> 		for (int horCnt = 0; horCnt < horFrames-1; horCnt++) {
> 			y = 0;
> 			for (int vertCnt = 0; vertCnt < vertFrames; vertCnt++) {
> 				try {
> 					((JInternalFrame)allFrames[frameIdx]).setMaximum(false);
> 				}
> 				catch (PropertyVetoException e) {
> 					e.printStackTrace();
> 				}
> 
> 				allFrames[frameIdx].setBounds(x, y, frameWidth, frameHeight);
> 				frameIdx++;
> 				y = y + frameHeight;
> 			}
> 			x = x + frameWidth;
> 		}
> 
> 		// the rest of the frames are tiled down on the last column with equal
> 		// height
> 		frameHeight = getBounds().height / (allFrames.length - frameIdx);
> 		y = 0;
> 		for (; frameIdx < allFrames.length; frameIdx++)
> 		{
> 			try {
> 				((JInternalFrame)allFrames[frameIdx]).setMaximum(false);
> 			}
> 			catch (PropertyVetoException e) {
> 				e.printStackTrace();
> 			}
> 
> 			allFrames[frameIdx].setBounds(x, y, frameWidth, frameHeight);
> 			y = y + frameHeight;
> 		}
> 
> 		checkDesktopSize();
> 	}
> 
> 	/**
> 	 * Arranges the frames as efficiently as possibly with preference for
> 	 * keeping horizontal size maximal.<br>
> 	 *
> 	 */
> 	public void arrangeFramesHorizontally() {
> 		java.awt.Component allFrames[] = getAllFrames();
> 		// do nothing if no frames to work with
> 		if (allFrames.length == 0) {
> 			return;
> 		}
> 
> 		manager.setNormalSize();
> 
> 		int horFrames;
> 		int vertFrames;
> 
> 		vertFrames = (int)Math.ceil(Math.sqrt(allFrames.length));
> 		horFrames = (int)Math.floor(Math.sqrt(allFrames.length));
> 
> 		// first arrange the windows that have equal size
> 		int frameWidth = getBounds().width / horFrames;
> 		int frameHeight = getBounds().height / vertFrames;
> 		int x = 0;
> 		int y = 0;
> 		int frameIdx = 0;
> 		for (int vertCnt = 0; vertCnt < vertFrames-1; vertCnt++) {
> 			x = 0;
> 			for (int horCnt = 0; horCnt < horFrames; horCnt++) {
> 				try {
> 					((JInternalFrame)allFrames[frameIdx]).setMaximum(false);
> 				}
> 				catch (PropertyVetoException e) {
> 					e.printStackTrace();
> 				}
> 
> 				allFrames[frameIdx].setBounds(x, y, frameWidth, frameHeight);
> 				frameIdx++;
> 				x = x + frameWidth;
> 			}
> 			y = y + frameHeight;
> 		}
> 
> 		// the rest of the frames are tiled down on the last column with equal
> 		// height
> 		frameWidth = getBounds().width / (allFrames.length - frameIdx);
> 		x = 0;
> 		for (; frameIdx < allFrames.length; frameIdx++)
> 		{
> 			try {
> 				((JInternalFrame)allFrames[frameIdx]).setMaximum(false);
> 			}
> 			catch (PropertyVetoException e) {
> 				e.printStackTrace();
> 			}
> 
> 			allFrames[frameIdx].setBounds(x, y, frameWidth, frameHeight);
> 			x = x + frameWidth;
> 		}
> 
> 		checkDesktopSize();
> 	}
> 
