Day of the Long Knives

I have been putting this off for several days now, but the time has finally come for me to pull out the long knives and begin slashing out the old Swing display structures, replacing them with a single AWT panel that I populate directly with simple graphics objects. In other words, I’m going to get rid of all the nested JPanels and have just a two AWT panels that I draw into with simple methods like drawRect, drawImage, and drawString. The reason for two panels is that one of them will need to be scrollable, so I want to take advantage of AWT’s scrolling capabilities.

But first I want to plan my strategy. I suppose that working bottom-up is the best approach. Here’s the current layout:

Current Display Layout

My goal is to collapse all this down to just two panels: one for the current actions, and one for the reference information. To work!

First roadblock
I didn’t get far before I ran into my first roadblock: AWT buttons can’t have images. They are rectangles with text inside, nothing more. This leaves me with two choices: drop down to AWT images and implement my own ActionListeners that make them behave like buttons, or climb back up to JButtons. A quick check revealed that an AWT container can contain a JButton. This strikes me as odd; a first-generation structure should not be able to understand a second-generation structure. I’m wary, but I suppose I’ll proceed using JButtons and be ready to implement the lower-order approach if necessary.

Later
I had originally planned to replace the code from the bottom up, replacing lower-level Swing components with AWT components, until I had the whole thing complete. But after several hours digging through the complexities of the existing structure, I am tempted to simply start from scratch and write something in AWT that handles the entire task, and then rip out the old code root and branch.