This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Jun 16, 2002
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
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.