Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: NullPointerException Problem... on: 2012-10-07 09:08:55
Thanx guys!!!!
2  Game Development / Newbie & Debugging Questions / NullPointerException Problem... on: 2012-10-06 21:12:16
Hi Guys,

lets get straight to the point. I have this problem:

Exception in thread "Thread-2" java.lang.NullPointerException
   at javax.swing.JComponent.getComponentGraphics(Unknown Source)
   at javax.swing.JComponent.paint(Unknown Source)
   at Display.Display.run(Display.java:39)
   at java.lang.Thread.run(Unknown Source)


So.. here is my code for one class:
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  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
package Display;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;

import javax.swing.JPanel;

public class Display extends JPanel implements Runnable {

   private Graphics g;
   private Thread gameThread;
   private boolean running = false;

   public Display() {
      gameThread = new Thread();
   }

   public void init() {
      running = true;
      gameThread = new Thread(this);
      gameThread.start();

   }

   public void update() {

   }

   public void draw(Graphics g){
     
   }

   @Override
   public void run() {
      while (running) {
         update();
         paint(g);
      }
   }

}


and the other class:
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  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
package fullscreen;

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;

import javax.swing.JFrame;

import Display.Display;

public class MainFrame extends JFrame {

   private static final long serialVersionUID = -485903859773002276L;
   private GraphicsDevice device;
   private boolean isFullScreen = false;
   private Display display = new Display();

   public MainFrame(GraphicsDevice device) {
      setTitle("SeemRang Fullscreen API");
      setDefaultCloseOperation(EXIT_ON_CLOSE);

      this.device = device;

      add(display);
      display.init();
   }

   public void begin() {
      isFullScreen = device.isFullScreenSupported();
      setUndecorated(isFullScreen);
      setResizable(!isFullScreen);

      if (isFullScreen) {
         // Full-screen mode
        device.setFullScreenWindow(this);
      } else {
         // Windowed mode
        pack();
         setVisible(true);
      }
   }

   public static void main(String[] args) {
      GraphicsEnvironment env = GraphicsEnvironment
            .getLocalGraphicsEnvironment();
      GraphicsDevice[] devices = env.getScreenDevices();

      for (int i = 0; i < 1; i++) {
         MainFrame test = new MainFrame(devices[i]);
         test.begin();
      }
   }
}


and the last.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
package fullscreen;

import java.awt.DisplayMode;

public class FullscreenInit {
   private DisplayMode modes;

   public FullscreenInit(DisplayMode modes) {
      this.modes = modes;
   }

   public DisplayMode getDisplayMode() {
      return modes;
   }

}


any solutions??? Any help will be appreciated.

Thnx,

LucaSeem Grin Grin Grin Grin Grin Grin Grin Grin
3  Game Development / Newbie & Debugging Questions / Re: Load MD5 Models in LWJGL on: 2012-10-05 17:14:31
ah... i think this complicates things a wee bit.... Tongue
 and if I succeed, i will post it here
4  Game Development / Newbie & Debugging Questions / Load MD5 Models in LWJGL on: 2012-10-04 18:51:15
Hi guys,

I was just wondering how to load MD5 models into an LWJGL (only using LWJGL, not external resource)

thnx

LucaSeem Clueless
5  Game Development / Newbie & Debugging Questions / Re: LWJGL COLLADA Loader on: 2012-10-02 17:24:11
how do i download it 2 my computer?? thnx Huh Huh Huh Huh Huh Huh Huh
6  Game Development / Newbie & Debugging Questions / Re: LWJGL COLLADA Loader on: 2012-10-02 17:20:29
I never called it an engine..... Grin Grin Grin Grin Cool
7  Game Development / Newbie & Debugging Questions / Re: LWJGL COLLADA Loader on: 2012-10-01 16:52:39
cos then i learn more java - i might as well use a game engine
8  Game Development / Newbie & Debugging Questions / Re: LWJGL COLLADA Loader on: 2012-10-01 16:19:13
Hi, sorry but I cant find a download Huh Huh Huh Huh Huh Huh Huh Huh Huh Huh Huh Huh Huh
9  Game Development / Newbie & Debugging Questions / Re: Newbie & Debugging Questions - Resources on: 2012-09-30 19:26:45
MYBRINGBACK.COM !!!!! AMAZING!!!!   Grin Grin Grin Grin Grin Grin Grin Grin Grin
10  Game Development / Newbie & Debugging Questions / LWJGL COLLADA Loader on: 2012-09-30 19:19:01
Hi Guys,

I just joined (this is my first post!) and I was wondering if there was a tutorial that could teach me how to load a COLLADA (.dae) file and view it into an LWJGL game window.

Thanks in advance,

LucaSeem Cheesy
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Pippogeek (38 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (31 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (53 views)
2014-09-19 03:14:18
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!