001 package market.swing;
002
003 import javax.swing.JTextArea;
004
005 import market.CIArticle;
006
007 /**
008 * The Area that contains information about CIArticles.
009 */
010 public class JTADescriptionArea extends JTextArea {
011
012 /**
013 * ID for serialization.
014 */
015 private static final long serialVersionUID = -6478825879587714380L;
016
017 public JTADescriptionArea() {
018 super();
019 setRows(5);
020 setLineWrap(true);
021 setWrapStyleWord(true);
022 setEditable(false);
023 }
024
025 /**
026 * Updates the description area according to the description date of the passed CIArticle.
027 * @param a the CIArticle from which the discription should be displayed.
028 */
029 public void setDescription(CIArticle a) {
030 this.setText("Hersteller: " + a.getDescription()[0] + "\n\n" + a.getDescription()[1]);
031 }
032 }