1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.devaki.nextobjects.ui.components;
21 import javax.swing.JTextArea;
22 /***
23 * This class overwrite the 'JTextarea' component.
24 */
25 public class CustomTextArea extends JTextArea
26 {
27 /***
28 * Construct a 'CustomTextArea' object
29 * @param text String to inialize the component with
30 * @param tooltipText Text that appears as a Tool Tips
31 * @param isEnabled Define if the component is enabled or not
32 * @param isEditable Define if the component is editable or not
33 */
34 public CustomTextArea(
35 final String text,
36 final String tooltipText,
37 final boolean isEnabled,
38 final boolean isEditable)
39 {
40 super(text);
41
42 if (tooltipText.length() != 0)
43 {
44 this.setToolTipText(tooltipText);
45 }
46
47 this.setEnabled(isEnabled);
48
49 this.setEditable(isEditable);
50 this.setLineWrap(true);
51 this.setWrapStyleWord(true);
52 }
53 }