>> No, seriously, it's because while you set the grid bag constraints for the JTable, you're not actually putting the JTable in the JPanel; you're actually putting the JScrollPane in the JPanel.
Thank you very much. I understand.
>> Try setting the grid bag constraints on the JScrollPane instead of on the JTable.
Yes, that works.
>> Oops, I just realized that might have been a homework problem, for which we're not supposed to give direct answers.
I�ve been following the posts on the
SCJD forum. I have not downloaded an assignment, because I don�t know enough. But I wrote a simple solution, so that I can understand the issues. Now I want to
test it. Since I don�t have the database file provided by SUN, I have to make one and fill it. For this purpose, I am writing a utility with a GUI interface. One JTable will be for the metadata, another JTable for the data.
So I guess, in some sense, it is a homework assignment. I am a student without a teacher. It is related to the SCJD assignment, but it seems like a generic utility.
>> So if it was, please read the following so that you learn something to replace the learning opportunity I accidentally took away from you:
>> Even though you probably stared at this for a while without seeing it, notice that a second set of eyes spotted it pretty quick (on the first reading of the document, in fact). The lesson to be learned is that code reviews by another programmer are a good way to spot bugs. There, I feel less guilty now.
Thank you for the advice.
Marlene