- A Concurrent Affair - https://www.concurrentaffair.org -

One DrJava Fix, Lots of COMP 202 Issues

I fixed one issue that had come up again: Competing modal dialogs. For some reason that I’ve already forgotten, we couldn’t use real modal dialogs that come in the form of Dialog or JDialog, so we just used a JFrame and listeners, and stole the focus back whenever someone took it from us. It worked for a while, because DrJava rarely used windows except for the main window.

In the last couple of years, though, we have added more and more windows: The predictive input dialogs to help you search or find Javadoc pages, the error dialog to collect and better display error messages while making them appear less critical, and now even the bottom panes and the debugger can be detached.

I handled most of this by creating a cooperative first-come-first-serve scheme of being modal. Every window that was trying to be modal, asked for modal status, but only one could have it. I considered moving making windows modal that were initially denied modal status, but left it there.

However, there were still other windows that could modally pop up, and those were real modal dialogs out of my control. In his bug report, [ 2040862 ] Modal dialog flicker: Project Properties/Increase Heap [1], Dan had one of my pseudo-modal dialogs (Project Properties) compete with a real modal dialog (Increase Heap).

Now I check whether the opposite window, the one that stole our focus, is a real modal dialog. If that is the case, we concede modalness. However, we install a listener that will make us modal again when the real modal dialog has been closed.

I have tried to simulate the problem with two windows competing, but I never quite succeeded, so I hope Dan or someone else can reproduce the problem and confirm that the issue has been fixed.

Shifting gears: I have been thinking and working a lot on the COMP 202 lecture notes, and website in general. I am taking over most of what was there from the previous year, but I am making a few changes. For example, I have decided to take more time for a few of the more difficult topics. I have also replaced two unpopular assignments with two assignments of mine, and I have replaced another assignment with one that I am more familiar with. I hope to maintain the level of teaching in general, but I also have to make sure I don’t completely overload myself. Better a little bit less but well done, than more with lots of confusion.

One thing I have to confess here, though: Please, please, no one edit HTML pages with Microsoft Word. Or some other very high-level editors. It pains me. I still edit HTML with emacs, and seeing all the superfluous tags hurts my eyes. Sometimes there is a separate tag around every letter of a word.

b [2]
ack

Just to do:

back [2]

I guess the previous students never looked at the HTML source (why should they have?), so I’m not surprised there were no complaints from them. But honestly, the computers rendering the HTML should have thrown up.

End rant.

[3] [4]Share [5]