* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
import com.sun.java.swing.*;
import com.sun.java.swing.text.*;
import com.sun.java.accessibility.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
/**
* Demo the Progress Bar
*
* @version 1.5 02/02/98
* @author Jeff Dinkins
# @author Peter Korn (accessibility support)
*/
public class ProgressPanel extends JPanel
{
SwingSet swing;
JProgressBar progressBar;
JTextArea progressTextArea;
JButton loadButton;
JButton stopButton;
LoadThread loadThread;
boolean shouldStop;
Object lock = new Object();
public ProgressPanel(SwingSet swing) {
this.swing = swing;
setLayout(new BorderLayout());
JPanel textWrapper = new JPanel(new BorderLayout());
textWrapper.setBorder(swing.loweredBorder);
textWrapper.setAlignmentX(LEFT_ALIGNMENT);
progressTextArea = new MyTextArea();
progressTextArea.getAccessibleContext().setAccessibleName("Text progressively being loaded in");
progressTextArea.getAccessibleContext().setAccessibleDescription("This JTextArea is being filled with text from a buffer progressively a character at a time while the progress bar a the bottom of the window shows the loading progress");