File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
sources/net.sf.j2s.java.core/src/swingjs/plaf Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4040
4141import javax .swing .BoxLayout ;
4242import javax .swing .InputMap ;
43+ import javax .swing .JApplet ;
4344import javax .swing .JComponent ;
4445import javax .swing .JMenu ;
4546import javax .swing .JMenuBar ;
@@ -111,7 +112,16 @@ public void propertyChange(PropertyChangeEvent e) {
111112 @ Override
112113 protected int getContainerHeight () {
113114 Insets m = menuBar .getInsets ();
114- return height = getFont ().getFontMetrics ().getHeight () + m .top + m .bottom ;
115+ height = getFont ().getFontMetrics ().getHeight () + m .top + m .bottom ;
116+ return height ;
117+ }
118+
119+ @ Override
120+ public void setVisible (boolean b ) {
121+ super .setVisible (b );
122+ Component top = menuBar .getTopLevelAncestor ();
123+ if ( top instanceof JApplet )
124+ ((JSAppletUI )((JApplet ) top ).getUI ()).checkMenuBar (b ? height : 0 );
115125 }
116126
117127 @ Override
You can’t perform that action at this time.
0 commit comments