001 package net.sourceforge.mp3dings.preferences;
002
003 /* Mp3dings - manage mp3 meta-information
004 * Copyright (C) 2003 Moritz Ringler
005 * $Id: TabbedPrefModule.java,v 1.6 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 javax.swing.BorderFactory;
024 import javax.swing.JTabbedPane;
025 /**
026 * A Preference Module, a container for similar PrefPanels.
027 * @author Moritz Ringler
028 * @version $Revision: 1.6 $ ($Date: 2006/09/25 17:34:42 $)
029 */
030 public class TabbedPrefModule extends AbstractPrefModule{
031 protected JTabbedPane book = new JTabbedPane();
032
033 public TabbedPrefModule(String name){
034 super(name);
035 setLayout(new BorderLayout());
036 book.setBorder(BorderFactory.createMatteBorder(2,0,2,0,getBackground()));
037 add(getTitle(), BorderLayout.NORTH);
038 add(book, BorderLayout.CENTER);
039 }
040
041 public void remove(PrefPanel panel){
042 super.remove(panel);
043 book.remove(panel);
044 }
045
046 public void addPanel(PrefPanel panel){
047 super.addPanel(panel);
048 book.add(panel);
049 }
050 }