how to auto-size JComponents
I'm sure there's a real easy way to do this so this might sound like a stupid question but... there's got to be a way to get a JComponent to automatically adjust it's width and height such that all its child components are all visible and fit nicely. I need this for both complex components (several levels of subcomponents within it) and simple components (JLabels, JButtons, etc). For the simple components, what I'm looking for is something such that I can call the constructor with an variable sized string, like a JLabel, and have the width automatically set its value so that no "..." appear at the end (ie. the whole string is visible). Any suggestions?
when you put the components in a frame, call the pack() method
sukuri.. you need to use a layout manager for that to work..
gibby.. see my signature, GridBag tutorial
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center