Results 1 to 5 of 5
- 02-16-2010, 05:57 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 21
- Rep Power
- 0
Any reason why half of components aren't drawing?
Hi
I've got a container that is meant to be drawing up to 100 JComponents.
Only about half of them are being drawn to the screen.
They are definitely being added to the container, as I have run several tests.
It seems that only the last 10 or so components that were added are being drawn.
Is there some sort of limitation on the number of components that can be drawn by a container?
Thanks
- 02-16-2010, 11:01 AM #2
Member
- Join Date
- Feb 2010
- Posts
- 21
- Rep Power
- 0
I just realised that I had forgotten to call validate. I thought that this would surely solve the problem, but no luck. This has had me stumped for the past two day, any advice would be great!
Some more information:
Each run of the game always gives a different number of components being drawn.
I tried running the game and skipping the menu screen, and it appeared to show more components, so perhaps this is a memory issue?
One thing is always the same - the components always start from the last in the array, so that the first element of the array is almost never shown.
- 02-17-2010, 12:48 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 21
- Rep Power
- 0
It is now working!
I think the problem lay in sending an Image as an argument to a class. I think I'll just stay away from that from now on.
- 02-17-2010, 02:28 AM #4
It is better to load an image only once, if you can help it; once it's loaded you can pass it to a great many objects as arguments.
My Hobby Project: LegacyClone
- 02-17-2010, 10:17 PM #5
Member
- Join Date
- Feb 2010
- Posts
- 21
- Rep Power
- 0
I think that the problem was that I was trying to pass an unloaded image to an object, and that object used the image to get its dimensions. So I figure, it was being given a width and height of 0. So what I did was feed the desired width and height to the object, and then created a variable and set it to the image, which worked perfectly.
Similar Threads
-
loop in a half
By Brain_Child in forum New To JavaReplies: 4Last Post: 12-02-2009, 03:00 AM -
[SOLVED] Can't pinpoint reason for this error..
By Reiyn in forum New To JavaReplies: 6Last Post: 03-30-2009, 06:39 PM -
Getting errors for some reason
By Swarvy in forum New To JavaReplies: 7Last Post: 09-30-2008, 02:45 PM -
Telecommute only at half rate
By Johnny Kewl in forum Jobs WantedReplies: 0Last Post: 05-11-2008, 04:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks