Win a copy of Head First Android this week in the Android forum!

Jeff Finn

Greenhorn
+ Follow
since Aug 07, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff Finn

I did try the list of lists thing, and it compiled, but I can't remember If I had trouble with the unchecked thing. The thing is, for reasons related to the program, I am synching the column index and the x-value for an Icon I am drawing. So It is nice to have an index that is always there. I am working on some other parts of the code right now, but when I have that squared away, I will print the code and show you what I am doing.
16 years ago
so, to do what I wanted, I made a class IconList that extends ArrayList.
then I made an array of type IconList, like so
IconList [] theBigList = new IconList[6]; since this array index will be fixed. is this OK?
Jeff
16 years ago
what are you suggesting by rewrite collections properly? Use a better data structure? What I want is something like 2-d array where each column is resized frequently. an array of lists seemed nice, buy that doesn't seem doable.
thanks,
Jeff
16 years ago
what is the proper way to declare this statement to avoid warnings about unchecked/unsafe operations?


I initialize this with the loop:


this won't compile:

says generic array creation.
16 years ago
I don't get the warning anymore. I think there was an issue with my project space and the IDE I was using, BlueJ. I started a new project in a new workspace, and the issues went away . here is a copy of the code in it's current form, please don't judge me for bad programming, I'm just trying to make it work. On the other hand, critique is welcome...



Can anyone suggest a more reliable IDE that isn't as complex as eclipse or netbeans? I would like to concentrate on learning Java, and big IDEs only complicate the issue.
16 years ago
Thank you for your reply.
I still get the warnings about unchecked calls, though. what is that about, if I have explicitly given the list a type?
thanks,
Jeff
16 years ago
the problem has mutated, looks like ArrayList is the way to go for resizing arrays alot, but I can't compile an ArrayList without a warning for unchecked call, like so:


compile warnings are:
16 years ago
I'm trying to implement a structure that is akin to a 2-d array, but each column will get resized alot. I was thinking that a a list of lists would be good, but am not sure how to implement that in java. Array list seems like the way to go.
I think I can do an array of lists, which will work, but is that acceptable practice? Lasty, I can't figure how to do explicit typing with ArrayList. here is some sample code:


in this line, "nums[i] = new ArrayList();",
how could I specify the type?

this declaration is what I keep wanting to do:
"nums[i] = new ArrayList<int>(); " but it doesn't compile. (unexpected type)
compiled on blueJ
16 years ago
wow. that's slick; I got a long way to go...
thanks for your help,
Jeff
16 years ago
now that It moves, how do I get rid of the flicker? or is it just my compiler?
16 years ago
Thank You for your Help, I've fixed my name, too.
16 years ago
I've been banging my head on this for a while now. In run() everything is peachy if I use show(). I'm pretty sure I need to use repaint() if I want to move the figure around the board without tracers. also, the thread doesn't quit when I close the app, but that's not my big problem now.

heres the code (all of it) edited, compiled and run in BlueJ

16 years ago
I've been banging my head on this for a while now. In run() everything is peachy if I use show(). I'm pretty sure I need to use repaint() if I want to move the figure around the board without tracers. also, the thread doesn't quit when I close the app, but that's not my big problem now.

heres the code (all of it) edited, compiled and run in BlueJ

16 years ago