Skip to content

no, what’s getModel() do?

Java isn’t a bad language, really. It’s got a lot of positive things going for it, and when things work right, they come together quite easily.

It’s just that it’s so incredibly picky.

Say that, for some reason, you want to include a GUI checkbox in a program. You can drop one in with no problems at all; it looks like a checkbox, it can be checked and unchecked, it has a string attached, all seems good. Then, say you want to find out what is the state of the checkbox. It turns out to be LITERALLY IMPOSSIBLE. You are REQUIRED to use Java’s event-driven methodology, which means more work, and more coding time. The checkbox MUST remember its own state internally; it just refuses to tell you. It’ll fire off an event, in case you’ve attached a listener, but that really seems like a whole lot of work to just retrieve a boolean value from a component.

I’m going to go to sleep, and work on this more tomorrow. I wish there was a language that combined the best features of Java and Perl. That is, I want it to be universally supported, have quick and easy GUI applications… and not enforce a specific programming style on you. Because maybe if you’re handling 40 checkboxes in a single page, an event driven model really is easier to code and reduces bugs and all that. But when you’ve got a single checkbox, in its own container class with some other things, and you just want the state so you can write the toString() for the container class… it’s just annoying.

RSS feed


No comments yet.

Sorry, the comment form is closed at this time.