/*
* File: LoadingFrame.java
* Created on 14 / desembre / 2007, 13:46
*
* Copyright (C) 2008 M.Àngels Cerveró Abelló
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package client.ws.milanas.gui;
import java.awt.Container;
import java.util.ResourceBundle;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.JTextField;
/**
*
* @author milana
*/
public class LoadingFrame extends JFrame
{
private JTextField authorText;
private JTextField titleText;
private JTextField keywordsText;
private JButton go;
private MilanasWSClientGUI parent;
/**
* Creates a new instance of LoadingFrame
*/
public LoadingFrame(ResourceBundle messages)
{
super(messages.getString("tab.loading.title"));
int y = 0;
this.parent = parent;
int width, height = 0;
JDesktopPane panel = new JDesktopPane();
Container content = getContentPane();
content.add(panel);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
JLabel message = new JLabel(messages.getString("label.loading"));
message.setSize((int) message.getPreferredSize().getWidth(), 30);
message.setLocation(0, 0);
panel.add(message);
width = (int) message.getSize().getWidth() + 10;
JProgressBar bar = new JProgressBar();
bar.setIndeterminate(true);
bar.setSize((int) bar.getPreferredSize().getWidth(), (int) bar.getPreferredSize().getHeight());
height = (int) (message.getSize().getHeight() + bar.getSize().getHeight()) + 40;
bar.setLocation((width - (int) bar.getSize().getWidth()) / 2, 30);
panel.add(bar);
setSize(width, height);
}
}