• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic