When the Next Button on a panel is disabled, the Cancel Button gets focus then when the Next Button is enabled again it never receives focus properly. Currently, the requestFocus() method is used and I tried switching it to the requestFocusInWindow() as is advised now, but it does not change focus properly either.
The end result is that end users try and press Enter to progress through the installer and after the installation progress (InstallPanel) they hit enter and the installer just "goes away" leaving a half-baked install. This behavior should be the case for ANY panel that disables the Next Button during the install.
Any objections?
public void unlockNextButton(boolean requestFocus)
{
nextButton.setEnabled(true);
if (requestFocus)
{
nextButton.requestFocusInWindow();
getRootPane().setDefaultButton(nextButton);
if (this.getFocusOwner()!=null) { Debug.trace("Current focus owner: "+this.getFocusOwner().getName()); }
if (!(getRootPane().getDefaultButton()==nextButton)) { Debug.trace("Next button not default button, setting..."); quitButton.setDefaultCapable(false); prevButton.setDefaultCapable(false); nextButton.setDefaultCapable(true); getRootPane().setDefaultButton(nextButton); }
}
}