Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JTextArea and GridBagLayout ??

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am having some trouble with JTextArea. I insert Strings by using the append() method,

for (int i = 0 ; i < ing.length - 1; i++ ) {
gekozenIngredienten.append((String )(ing[ i ] + ", "));

and that causes the JTextArea to grow in width. But when I am setting Linewrap to true my GridbagLayout turns in some really ugly screen. Does anyone know how to add Strings to a JTextArea without the Area to grow in width ?? Or setting LineWrap to true without my GridBagLayout going of the screen ?

Thanx Haiko
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
another cross-poster
http://www.javaworld.com/javaforums/showflat.php?Cat=&Board=javabeginner&Number=15802&page=0&view=collapsed&sb=5&o=&fpart=1

anither one on the ignore list
 
Haiko van der Schaaf
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael, is it illegal to post on two different forums ?? And if not, isn 't there a ex-Stasi meeting you should attend ?
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I will advice you to check the GridBagConstraints you set
that is the cause of the problem.Because i don't think adding
String to text or setting lineWrap to true will cause any problem
check the constraints you set.
 
Haiko van der Schaaf
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx, that fixed the problem. I have added weightX constraints and that did the trick.

Gr. Haiko
 
reply
    Bookmark Topic Watch Topic
  • New Topic