Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
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  
  Weird rendering glitch  (Read 2465 times)
0 Members and 1 Guest are viewing this topic.
Offline Jesse_Attard

Senior Newbie

« Posted 2010-03-19 14:48:17 »


One of my customers is experiencing a very strange problem when trying to access my game.  It's a Java Applet.  Just to be clear - this is the applet loading screen.  It does it when displaying the game too.  He says it's happening in all 3 browsers (ie, firefox, chrome).  Given that it's happening on the applet load screen I feel like the HTML must be the culprit, but to be honest I'm completely stumped here.

Here's a screenshot:

Here's how it's supposed to look:

Here's another example of the login screen (this is in-game code)

and how it's supposed to look:

Ignore the debug info - was just some stuff I printed to help debug the problem.

Anyone seen this before or have any idea what's going on here?  Most of my customers have no problem.  Website is
Offline Dathgale

Junior Newbie

« Reply #1 - Posted 2010-03-19 15:55:33 »

It's probably a browser problem. I would ask your customers what browser they're using if I were you. It looks like the applet is not being repainted after it is invalidated. Calling the applet's repaint() method after it loads might fix the login screen. As for the loading screen, consider using this kind of loading screen instead.
Offline Wildern

Junior Devvie

« Reply #2 - Posted 2010-03-19 20:19:24 »

Your load screen appears to just be an animated gif
How are you displaying it?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jesse_Attard

Senior Newbie

« Reply #3 - Posted 2010-03-20 02:05:54 »

Yeah the browsers are IE, Mozilla, and Chrome.  All 3 it's doing this on his machine.  I've tried all three locally and they all work fine for me.

The applet calls repaint() on the Canvas every frame.  ie. there is a main thread that runs the game and calls the repaint method every X milliseconds.  I add the main Canvas to the JApplet's ContentPane on applet initialization. I can try calling repaint() on the Applet itself... will let you know how that goes.

For the load screen (which I'm less concerned about if the game ends up working fine) the HTML is as follows:
<title>Immortal Empire</title>
<link rel="stylesheet" href="iempire.css" type="text/css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<TABLE WIDTH=100% border=0 cellpadding=0 cellspacing=0>
<applet code=Main.IsoGame.class width="800" height="600">
<param name="boxbgcolor" value="#000000">
<param name="boxfgcolor" value="#000000">
<param name="progresscolor" value="#9B5000">
<param name="boxborder" value="false">
<param name="image" value="ie_loadscreen.gif">
<param name="cache_archive" value="IsoGame.jar,IsoImages_interface.jar,IsoImages_game.jar,IsoSounds_interface.jar,IsoSounds_game.jar,IsoMusic_bossbattle.jar,IsoMusic_cinematic_standard.jar,IsoMusic_cinematic_vuldreth.jar,IsoMusic_desert.jar,IsoMusic_dialog_dazo.jar,IsoMusic_dialog_elder.jar,IsoMusic_dialog_maielle.jar,IsoMusic_grasslands.jar,IsoMusic_menu_0.jar,IsoMusic_menu_1.jar,IsoMusic_volcanic.jar,IsoLib_jogg.jar,IsoLib_jorbis.jar,IsoLib_tritonius.jar,IsoLib_vorbis.jar">
<param name="cache_option" value="Plugin">
<param name="cache_version" value=",0.0.1.D,0.0.1.C,,,,,,,,,,,,,,,,,">
You cannot play this game because you do not have Java installed.  Java is a free download, please acquire it from <A HREF="" target="_blank"></A>.

It took me a while to settle on this type of deployment since it handles JAR caching and JAR indexing correctly in all browsers without needing javascript. I don't use JNLP - but maybe I should?
Offline pjt33

« JGO Spiffy Duke »

Medals: 40
Projects: 4
Exp: 7 years

« Reply #4 - Posted 2010-03-20 09:22:40 »

Do you hang on to the Graphics object from the paint/paintComponent call? That can cause interesting problems on Windows.
Offline Jesse_Attard

Senior Newbie

« Reply #5 - Posted 2010-03-20 16:49:40 »

I store the Graphics object of the backbuffer as a member variable of the main frame. It's just an image I use for double buffering to prevent flickering.  I don't store the Graphics object of the paint() method that's passed as a parameter. 
Pages: [1]
  ignore  |  Print  

hadezbladez (335 views)
2018-11-16 13:46:03

hadezbladez (180 views)
2018-11-16 13:41:33

hadezbladez (336 views)
2018-11-16 13:35:35

hadezbladez (82 views)
2018-11-16 13:32:03

EgonOlsen (2177 views)
2018-06-10 19:43:48

EgonOlsen (2205 views)
2018-06-10 19:43:44

EgonOlsen (1376 views)
2018-06-10 19:43:20

DesertCoockie (2008 views)
2018-05-13 18:23:11

nelsongames (1646 views)
2018-04-24 18:15:36

nelsongames (2297 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!