public void mouseReleased(MouseEvent e) {
                    Insets insets = getInsets();
                    int width = getWidth();
                    int height = getHeight();
                    int availw = width - insets.left - insets.right;
                    int availh = height - insets.top - insets.bottom;
                    if (CustomSplitPane.this.horizonal && dy != -1) {
                        setSplit((double) dx / availw);
                    } else if (dx != -1) {
                        setSplit((double) dy / availh);
                    }
                    dx = dy = -1;
                    spacer.setOpaque(false);
                    repaint();
                }