[Schmitzm-commits] r2137 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sun Nov 11 18:08:09 CET 2012


Author: mojays
Date: 2012-11-11 18:08:09 +0100 (Sun, 11 Nov 2012)
New Revision: 2137

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
Log:
SwingUtil.createLimitedTextArea(.): number of lines

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2012-11-11 16:37:49 UTC (rev 2136)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2012-11-11 17:08:09 UTC (rev 2137)
@@ -2021,12 +2021,16 @@
 	 * Creates limited text input field.
 	 * @param limit limits the character count
 	 * @param style see styled in {@link LimitedDocument}
+     * @param lines number of lines for {@link JTextArea}
 	 */
-	public static JTextArea createLimitedTextArea(int limit, int style) {
+	public static JTextArea createLimitedTextArea(int limit, int style, int lines) {
 	  LimitedDocument doc = new LimitedDocument(limit, style);
 	  JTextArea field = new JTextArea();
 	  field.setDocument(doc);
 	  field.setFont(DEFAULT_FONT_TEXTPANE);
+	  field.setAutoscrolls(false);
+	  if ( lines >= 1 )
+	    field.setRows(lines);
 	  return field;
 	}
 	



More information about the Schmitzm-commits mailing list