private void rearrange() {
        if (this.getComponent(0) != splitPane1) {
            this.removeAll();
            this.add(splitPane2);
        }
        switch (currItems) {
            case 7:
                splitPane1.setLeftComponent(xmlView);
                splitPane1.setRightComponent(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                        textView, treeView));
                splitPane2.setTopComponent(splitPane1);
                return;
            case 6:
                splitPane1.setLeftComponent(xmlView);
                splitPane1.setRightComponent(textView);
                splitPane2.setTopComponent(splitPane1);
                return;
            case 5:
                splitPane1.setLeftComponent(textView);
                splitPane1.setRightComponent(treeView);
                splitPane2.setTopComponent(splitPane1);
                return;
            case 4:
                this.removeAll();
                splitPane2.setTopComponent(textView);
                this.add(splitPane2);
                return;
            case 3:
                splitPane1.setLeftComponent(xmlView);
                splitPane1.setRightComponent(treeView);
                return;
            case 2:
                this.removeAll();
                splitPane2.setTopComponent(xmlView);

                this.add(splitPane2);
                return;
            case 1:
                this.removeAll();
                splitPane2.setTopComponent(treeView);
                this.add(splitPane2);
        }
    }