J
Jason Cavett
I'm a little confused when I should use the various JComponent
methods: setPreferredSize, setMinimumSize and setSize. From what I
can tell:
setPreferredSize(Dimension) - This is (obviously) the preferred size
of the component. As far as I can tell, this is used to determine
what size the component should be when pack() is used.
setMinimumSize - The component cannot be any smaller than this.
setSize - Set the current size (hard value).
What I'm confused about is...
1. When I should use each method.
2. Currently, when I resize a frame, the JTextBoxes will resize for
part of the time and then, as the JFrame gets smaller, they will
collapse to an extremely small size (1 character wide...if that). Do
I *have* to use setMinimumSize to prevent this from happening?/
Thanks for any info. Appreciate it.
methods: setPreferredSize, setMinimumSize and setSize. From what I
can tell:
setPreferredSize(Dimension) - This is (obviously) the preferred size
of the component. As far as I can tell, this is used to determine
what size the component should be when pack() is used.
setMinimumSize - The component cannot be any smaller than this.
setSize - Set the current size (hard value).
What I'm confused about is...
1. When I should use each method.
2. Currently, when I resize a frame, the JTextBoxes will resize for
part of the time and then, as the JFrame gets smaller, they will
collapse to an extremely small size (1 character wide...if that). Do
I *have* to use setMinimumSize to prevent this from happening?/
Thanks for any info. Appreciate it.