EVALUATION
I'm able to reproduce this on 1.4.b48.
mark.davidson@Eng 2001-01-19
As an initial fix, I've implemented checks for GraphicsEnvironment.isHeadless() in along the execution path. That only suceeds in pushing the encountered exception to other parts of the API (like in SwingUtilities.convertScreenLocationToParent()).
The meta question to ask is: does it make sense to call JPopupMenu.setVisible(true) in a headless environment? If so then what should happen?
mark.davidson@Eng 2001-03-19
Name: pzR10082 Date: 05/17/2001
It's hard to say what the submitted code is intended for, however,
there should be no NPE thrown anyway.
###@###.### 2001-05-17
======================================================================
|
SUGGESTED FIX
Name: pzR10082 Date: 05/17/2001
The solution could be just to add a check for null to
the JPopupMenu.setVisible() method. Other Swing components
seem not to have this problem: JPopupMenu just has a very
special setVisible() method.
*** /tmp/geta1237 Thu May 17 16:09:09 2001
--- JPopupMenu.java Thu May 17 15:41:27 2001
***************
*** 747,753 ****
desiredLocationY);
popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
! newPopup.show();
return newPopup;
}
--- 747,755 ----
desiredLocationY);
popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
! if (newPopup != null) {
! newPopup.show();
! }
return newPopup;
}
###@###.### 2001-05-17
======================================================================
|