I'm back to that Java learning project, which incidentally is something I need for Project Bluebird. It's got a fairly simple GUI, which makes it seem like a good candidate for tossing together with the GUI designer feature of Netbeans, no?
Well, no. I'm overhauling the user interface to make it match the way the database is actually going to work, and one part of the overhaul is replacing a bunch of distinctively-named text fields in a gridbag with a jTable. (I'll worry later about how to put jButtons in table cells, so's they'll line up with the rows.)
I hadn't used a table in the first place because the older version of Netbeans had a dysfunctional approach to adding tables to forms.
Well, Netbeans 5.5.1 seems to be even more dysfunctional. Adding a table gets me a 4x4 table of empty cells wrapped in a jScrollPane. With no visible way of changing the number of cells, nor of adding a title, nor of filling in any fixed content I might want.
Oh, and as an added bonus, the jScrollPane defaults to an itsy-teeny little box, scrunching the table down to nothing.
Throw in the fun detail that, in many cases, either the "Design" pane or the "Preview" function in Netbeans doesn't match what the actual program will display when it's run, especially with regard to the width of blank text fields, and this GUI designer becomes rather less than useful.
Probably be easier just to use a good old fashioned text editor and a good reference book, and to heck with the IDE and its WYSINLTBWYG form editor thingie.
(OK: What You See Is Not Likely To Be What You Get.)
Update: Oh, of course! Setting the row and column counts, as well as the column titles, is done under the table's "model" attribute. How utterly intuitive and not-in-need-of-documentation! And now, ladies and gentlemen, for my next death-defying illusion, I shall attempt to find the control for making the column titles visible!
Update 2: Hokay, so the titles are visible if every column has a title, and automagically get invisibled if any title is blank. Wunnerful. The last column doesn't really have a meaningful title, and I was kinds hoping to leave it blunk out.
Comments