001    package net.sourceforge.mp3dings.preferences;
002    
003    /* Mp3dings - manage mp3 meta-information
004     * Copyright (C) 2003 Moritz Ringler
005     * $Id: VBoxModule.java,v 1.3 2006/09/25 17:34:42 ringler Exp $
006     *
007     * This program is free software; you can redistribute it and/or
008     * modify it under the terms of the GNU General Public License
009     * as published by the Free Software Foundation; either version 2
010     * of the License, or (at your option) any later version.
011     *
012     * This program is distributed in the hope that it will be useful,
013     * but WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015     * GNU General Public License for more details.
016     *
017     * You should have received a copy of the GNU General Public License
018     * along with this program; if not, write to the Free Software
019     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
020     */
021    
022    import java.awt.BorderLayout;
023    import java.awt.GridLayout;
024    import javax.swing.BorderFactory;
025    import javax.swing.JPanel;
026    
027    /**
028     * A Preference Module, a container for a single PrefPanel.
029     * @author Moritz Ringler
030     * @version $Revision: 1.3 $ ($Date: 2006/09/25 17:34:42 $)
031     */
032    public class VBoxModule extends AbstractPrefModule{
033        JPanel child = new JPanel(new GridLayout(0,1,0,5));
034    
035        public VBoxModule(String name){
036            super(name);
037            setLayout(new BorderLayout());
038            add(getTitle(), BorderLayout.NORTH);
039            child.setBorder(BorderFactory.createMatteBorder(2,0,2,0,getBackground()));
040            child.setOpaque(true);
041            child.setBackground(getBackground());
042            JPanel box = new JPanel(new BorderLayout());
043            box.setOpaque(false);
044            box.add(child,  BorderLayout.NORTH);
045            add(box, BorderLayout.CENTER);
046        }
047    
048        public void addPanel(PrefPanel panel){
049            super.addPanel(panel);
050            child.add(panel, BorderLayout.NORTH);
051        }
052    }