• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Dynamically setting TextArea size

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am having an AWT window with a TextArea and few buttons. i wanted to view text files in my TextArea box. as i dont know the file size before how can i set the size of the TextArea. is there an way that we can dynamically set the size of TextArea.
Thanks
Regards
Chandhrasekar Saravanan
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't matter... if the TextArea is too small for the amount of text being displayed it has a scrollbar to allow the user to scroll through the text.
 
Chandhrasekar Saravanan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think i havent mentioned the problem clearly. I do have a scrollbars in my Textarea. the problem is i need to mention an initial size. if my file is too large, even though i have scrollbars, i am not able to display the files when it exceeds the Textarea size. how to overcome this problem
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, sounds like a layout problem. What kind of layout does the component you are adding the text area to have? BorderLayout would make the most sense. Add the text area to the center and it takes up all available space not taken up by other components in the other sections of the layout.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic