Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Can't Display MenuBar in Full Screen Mode  (Read 886 times)
0 Members and 1 Guest are viewing this topic.
Offline Peppi

Junior Newbie




Java games rock!


« Posted 2003-03-03 18:27:18 »

Ok first post so be gentle  Wink
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
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
 
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
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #1 - Posted 2003-03-04 00:52:05 »

I can't say I really read your post but AWT/Swing stuff isn't really intended for fullscreen mode and if it works at all you should be surprised.

IMO game GUI is a big problem since you basically have to create it all yourself. So far as I've seen, no one has released anything like that publicly. The stuff I've seen has been extremely simple and wouldnt work all that great for any semi-complex game.

I dunno how to help you. :/
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (23 views)
2014-08-19 09:29:53

Tekkerue (22 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (57 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (36 views)
2014-08-06 19:49:38

BurntPizza (66 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!