001/*
002 * Copyright 2010-2015 Institut Pasteur.
003 * 
004 * This file is part of Icy.
005 * 
006 * Icy is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 * 
011 * Icy is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 * 
016 * You should have received a copy of the GNU General Public License
017 * along with Icy. If not, see <http://www.gnu.org/licenses/>.
018 */
019package icy.gui.frame;
020
021import icy.gui.component.IcyPanel;
022
023import java.awt.Color;
024import java.awt.Dimension;
025
026import javax.swing.BoxLayout;
027import javax.swing.JLabel;
028import javax.swing.JScrollPane;
029
030/**
031 * @deprecated Don't use this anymore
032 * @author stephane
033 */
034@Deprecated
035public class LabelFrame extends IcyFrame
036{
037    public LabelFrame(String text)
038    {
039        this("Text", text);
040    }
041
042    public LabelFrame(String title, String text)
043    {
044        super(title, true, true, false, false);
045
046        final JLabel label = new JLabel(text);
047        label.setForeground(Color.white);
048
049        final IcyPanel panel = new IcyPanel();
050        panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
051
052        panel.add(label);
053
054        add(new JScrollPane(panel));
055
056        setMinimumSize(new Dimension(400, 300));
057        setPreferredSize(new Dimension(400, 300));
058
059        pack();
060        validate();
061
062        setVisible(true);
063    }
064}