question: @ Override protected JPopupMenu createPopupMenu ( boolean properties , boolean save , boolean print , boolean zoom ) { JPopupMenu result = super . createPopupMenu ( properties , save , print , zoom ) ; int zoomInIndex = getPopupMenuItem ( result , localizationResources . getString ( "Zoom_In" ) ) ; int zoomOutIndex = getPopupMenuItem ( result , localizationResources . getString ( "Zoom_Out" ) ) ; int autoIndex = getPopupMenuItem ( result , localizationResources . getString ( "Auto_Range" ) ) ; if ( zoom ) { JMenuItem zoomIn = new JMenuItem ( localizationResources . getString ( "Zoom_In" ) ) ; zoomIn . setActionCommand ( POLAR_ZOOM_IN_ACTION_COMMAND ) ; zoomIn . addActionListener ( this ) ; JMenuItem zoomOut = new JMenuItem ( localizationResources . getString ( "Zoom_Out" ) ) ; zoomOut . setActionCommand ( POLAR_ZOOM_OUT_ACTION_COMMAND ) ; zoomOut . addActionListener ( this ) ; JMenuItem auto = new JMenuItem ( localizationResources . getString ( "Auto_Range" ) ) ; auto . setActionCommand ( POLAR_AUTO_RANGE_ACTION_COMMAND ) ; auto . addActionListener ( this ) ; if ( zoomInIndex != - 1 ) { result . remove ( zoomInIndex ) ; } else { zoomInIndex = result . getComponentCount ( ) - 1 ; } result . add ( zoomIn , zoomInIndex ) ; if ( zoomOutIndex != - 1 ) { result . remove ( zoomOutIndex ) ; } else { zoomOutIndex = zoomInIndex + 1 ; } result . add ( zoomOut , zoomOutIndex ) ; if ( autoIndex != - 1 ) { result . remove ( autoIndex ) ; } else { autoIndex = zoomOutIndex + 1 ; } result . add ( auto , autoIndex ) ; } return result ; }
target:  Creates a popup menu for the panel.