i have a question about JFrame. is there anyway to set the size of frame as automatic depending about the values in the frame.so if the values is a lot more than what is expected that frame adjust it self it fit all the data ?
A frame will size itself according to the components contained within. Whether that answers your question about the "data" remains to be seen (since I, obviously, have no idea how your displaying that "data"). But, as a hunch, no, you do not have to use setSize() on a JFrame.
maybe, but that doesn't resize anything on the visible frame, which is what's usually meant by such questions :)
It's also unreliable, depends on what component you're working with and how it's placed.
Essentially, one should not depend on hardwiring component sizes.
And indeed, wrap that JTextArea with a JScrollPane.