6888634: test/closed/javax/swing/Popup/TaskbarPositionTest.java fails

Reviewed-by: alexp
This commit is contained in:
Pavel Porvatov 2012-03-22 17:10:48 +02:00
parent ba42773298
commit e7fc59fe99

View File

@ -359,17 +359,20 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
int scrBottomY = scrBounds.y + scrHeight;
// Ensure that popup menu fits the screen
if (popupRightX > (long)scrRightX) {
if (popupRightX > (long) scrRightX) {
popupLocation.x = scrRightX - popupSize.width;
if( popupLocation.x < scrBounds.x ) {
popupLocation.x = scrBounds.x ;
}
}
if (popupBottomY > (long)scrBottomY) {
if (popupBottomY > (long) scrBottomY) {
popupLocation.y = scrBottomY - popupSize.height;
if( popupLocation.y < scrBounds.y ) {
popupLocation.y = scrBounds.y;
}
}
if (popupLocation.x < scrBounds.x) {
popupLocation.x = scrBounds.x;
}
if (popupLocation.y < scrBounds.y) {
popupLocation.y = scrBounds.y;
}
return popupLocation;