Results 1 to 3 of 3
- 02-04-2012, 08:37 AM #1
Member
- Join Date
- Jan 2012
- Location
- Adelaide, Australia
- Posts
- 17
- Rep Power
- 0
JPanel paintComponent, OS differences
I've been making a simple tileGame (on windows vista), which paints 2400 pictured tiles on-screen at any given time (using bufferstrategy as is default with swing component). This all runs just dandy on my windows computer, from within eclipse, and when I export it as a runnable JAR.
My brother uses a mac computer to code java, also using eclipse. When I send him the exact same code and he runs it, it seems to lag with some unpainted white strips whenever the player moves (the background moves, not the player). Why is this???
I thought that maybe on mac bufferstrategy does not work, as this is how it used to run (on windows) before implementing swing and bufferstrategy (some tiles are being painted before others?, creating the thin unpainted strips?).
Thanks for the help anyways!
- 02-13-2012, 02:19 AM #2
Re: JPanel paintComponent, OS differences
Hard to say ... set the background color of the component that you are painting to another color ... if the stripes then change colors you have failed in the paintcomponent method. Also what do you mean by 2400 tiles on the screen ? Do you paint all of them? Then you will have memory problems.
- 02-13-2012, 05:01 AM #3
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
Similar Threads
-
the graphics won't show up when i use the methord paintComponent of JPanel class.HELP
By mcclain in forum AWT / SwingReplies: 5Last Post: 10-02-2011, 02:55 AM -
Boosting differences
By belsen in forum LuceneReplies: 0Last Post: 11-24-2010, 09:26 AM -
JPanel PaintComponent
By capiono in forum AWT / SwingReplies: 5Last Post: 10-31-2010, 03:36 AM -
paint vs paintComponent for a JPanel
By lightstream in forum AWT / SwingReplies: 4Last Post: 01-29-2009, 02:26 AM -
differences: AWT and Swing
By baltimore in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 09:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks