import java.awt.*; import java.awt.event.*; import java.lang.Integer; import java.util.Calendar; import java.io.File; import javax.swing.*; import javax.swing.event.*; /** * TextScrollPane - Scrolling pane for text entry. * * @author Paul Kronenwetter * @author Jayme Manning * *
* Paul Kronenwetter
* Jayme Manning
* Trade Secrets and/or Confidential
* Commercial or Financial Information
* Exempt From Disclosure Under the Freedom
* of Information Act (5 USC 552(b)(3)
* and 5 USC 552(b)(4)) and Under 18 USC 1905
*
* Proprietary Information Notice
*
© 1998 by Paul Kronenwetter and Jayme
* Manning
All Rights Reserved
* *
* $Log: TextScrollPane.java,v $ * Revision 1.2 1998/12/17 17:16:20 cps606 * Added method to retrieve text. * * Revision 1.1 1998/12/17 03:25:50 cps606 * Created to deal with creating a scrolling text panel. * **/ public class TextScrollPane extends JScrollPane { private final String rcsId="$Id: TextScrollPane.java,v 1.2 1998/12/17 17:16:20 cps606 Exp $"; private JScrollPane scrollPane; private JTextArea textArea; /** * Replies to requests for this component's preferred size. * * @return The preferred size of this panel in a Dimension. */ public Dimension getPreferredSize() { return new Dimension(250,150); } // Start of private methods and classes. /** * This is the method that does the "real" work of setting up the * variables and other objects needed to make this panel work. */ public TextScrollPane() { // Create the text area... textArea = new JTextArea(); add(textArea); setViewportView(textArea); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER); setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setVisible(true); } /** * clearText - Method used to clear the JTextArea for further processing. */ public void clearText() { textArea.setText(""); } /** * getText - Method used to retrieve the text of our embedded JTextArea * component. * * @return String - The text from the JTextArea. */ public String getText() { return textArea.getText(); } }