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 public JTADescriptionArea() {
013 super();
014 setRows(5);
015 setLineWrap(true);
016 setWrapStyleWord(true);
017 setEditable(false);
018 }
019
020 /**
021 * Updates the description area according to the description date of the passed CIArticle.
022 * @param a the CIArticle from which the discription should be displayed.
023 */
024 public void setDescription(CIArticle a) {
025 this.setText("Hersteller: " + a.getDescription()[0] + "\n\n" + a.getDescription()[1]);
026 }
027 }