At first, your question was missing key details. That's the primary reason for it being closed - without a clear picture of what was being done, the question was impossible to answer.
In your defense, you did go back and add that information (your example code) prior to the question being closed - but by then, it had already attracted several votes; in effect, the bar for closing was lower than it would've been initially.
At this point, several other factors entered the picture:
Your title was not very descriptive: writing good titles is hard, but they are probably the single most influential part of your post! Note how I edited your titles on both the main site and here on Meta to attempt to capture the essence of the question, condensed down into a line or two - strive to do the same yourself in the future.
You went from almost no code to a 74-line listing! You did appear to put some effort into reducing your listing down to a manageable length, but there was still a lot of irrelevant stuff in that listing. The goal should always be to write the smallest possible program that still reproduces the bug you're trying to fix: in this case, that's a single panel and a render method. I actually edited this down more than I should've (and then restored part of it) and realistically you would've needed to be as strict as I was - but keep in mind, the less code you include (while still providing enough to reproduce the bug), the faster others will be able to read it and the more likely you are to get an effective answer.
Your code was poorly formatted. This may seem like a very small thing, but again: you're trying to remove as many barriers as possible between potential readers and an understanding of your post. So make your indentation consistent (and minimal - I usually stick with 2 or three-space indents to reduce horizontal scrolling), use whitespace judiciously to separate distinct areas of your program, and include comments to point out key sections.
None of these was damning on its own, but combined with one another and the fact that the post wasn't originally complete meant that it really wasn't an appealing question when it came up for review.
In the future, strive to put your best foot forward when asking questions, and I think you'll have a much easier time of it.