Four Panel Splitpane

Hi i have created a simple slitpane with 4 panels in but i have some kind of small bug
you can resize the panels perfect you can even maximize 1 view by doubleclicking it
But when you maximize the green view and then doubleclick in t he area were the white panel was to retore views to normal
the white panel has disappeared. any1 who has an idea? I dont have this problem with the other 3 panels

I have included code into jar
http://users.skynet.be/fa006997/FourPanelSplitPane.jar

Hi !

Inside your maxView method, when one of the panels is maxed, you shouldn’t bother with the four checks. Just put all panels on visible, and recalculate your bounds. Here is the updated code:


public void maxView(Point p) {
	if (maxed) {
		maxed = false;
		NW.setVisible(true);
		NE.setVisible(true);
		SW.setVisible(true);
		SE.setVisible(true);
		ratioWidth = oldRatioWidth;
		ratioHeight = oldRatioHeight;
		calculateViews();
		calculateDividers();
	} 
	else {
		//keep this intact
	}
}

You see, even when green is maxed, you were clicking inside the bounds of the white box (the green and the white bounds overlap, even though the white box is invisible). This caused your code to enter the “wrong” block, the one for the white box.

BTW: nederlandse commentaar is niet voor iedereen even makkelijk te lezen :wink:

thx that was my problem :slight_smile:

true but i aint gonna write english comment because i might have to post it on here :wink: