Original Post
I've been using Java 1.4.2 for my university course. I'm on the verge of writing a big program in it for the first time, and as it's a group project and I'm the "tech guy", I have certain decisions to make. I want to get them right. However, one of these decisions is giving me a bit of a headache: whether or not to use LayoutManagers. We have to create a GUI with the Swing library. I have tried to use LayoutManagers, but they seem next to useless. I honestly can't imagine why you'd want to have your controls laid out in the various bizarre styles the managers encapsulate. It seems counter-intuitive, and contrary to every other GUI creation system I've ever encountered. I've resorted to just turning off the LayoutManager in all my frames, and setting the positions of things manually. This has led to problems. You can't autosize controls to accommodate different font sizes or string lengths, for example. I've had to resize them manually, guessing their sizes. I did have a problem with detecting when frames I'm using change size, in order to recalculate the layout of the controls in them, but I've solved that by employing a ComponentListener to get resize notifications. These problems are causing me to ask the question: am I missing something with LayoutManagers? The GUI we've designed and the LayoutManagers don't seem at all compatible (and it's a pretty standard GUI, you'd have no trouble putting it together with Visual Basic or C++). Do I have no choice but to continue manually calculating and recalculating? Are there some situations in which LayoutManagers are wholly unsuitable for the task in hand? Thanks in advance for any replies...