Ok first post so be gentle
My app can be run in full screen mode or in windowed mode. The structure of it is a Frame with a MenuBar and a Panel added to it respectfully. I use Active Rendering using a bufferStrategy. I display the game info on the Panel, and I display my graphics in the frame (I used to have it displayed in another Panel but once I switched to a bufferStrategy that did not work). Ok so in windowed mode everything works fine, but when I put the app into Full Screen mode things start to go bad. First of all the Panel that I display my game info on starts to flicker, and the menubar disappears completely. I solved the Panel flickering problem by calling frame.paintAll() in my rendering loop, that āseemedā to fix that problem but my MenuBar is still not showing. I know it is there because I can sort of clik on it but then it quickly disappears.
My app used to be a JFrame with a JPanel and a JMenuBar but in windowed mode the JmenuBarās children would get hidden by my frame, so I changed everything to AWT and that āsolvedā the problem.
here is the rendering code
public void update() {
Dimension d = (new Dime(GAMEWIDTH,GAMEHEIGHT));
if( !bufferStrategy.contentsLost() ) {
Graphics g = bufferStrategy.getDrawGraphics();
if( fs ){ // if full screen
frame.paintAll(g);
// Clear the drawing buffer to black
g.setColor( Color.black );
g.fillRect( 0, 19, d.width-1, d.height+23 );
}
else{
// Clear the drawing buffer to white
g.setColor( Color.black );
g.fillRect( 0, 41, d.width-1, d.height );
g.setColor( Color.lightGray );
g.fillRect( d.width-1, 41, d.width, d.height );
}
.
.
.
.
Any help? anyone encounter this problem before with the MenuBar disappearing?
Thanks for your time
Peppi