This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm using GridBagLayout in a complex form and I simply want to have each 'cell' be exactly the same width, when the size of the window changes the width of each cell scales accordingly, but each cell always remains the same size as the other. This way I can simply place items by specifying the location and number of cells it takes and have it always scale accordingly. My problem is simple, the size of my cells are being adjusted because JLabels want more space, it's causing problems. I'm guessing that it's the JLabels minimum size being set based upon the text, which in turn causes the cell(s) it is in to modify their sizes to accomodate it. I don't want this! I dont' care if the text in the label gets cut off, I want to width of each cell to stay the same for each cell REGARDLESS of whether or not the components contained in them think they need more room. How do I accomplish this? I thought I could just override each components minimumSize but that doesn't seem to work! I tried using columnWeights and columnWidths in GridBagLayout but that didn't seem to have any affect either! Help!!!