after that i changed i++ in snake move methood to i-- which was my mistake but still i m getting problem as shown
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 1
at java.util.LinkedList.checkElementIndex(LinkedList.java:553)
at java.util.LinkedList.get(LinkedList.java:474)
at snake.Snake.move(Snake.java:61)
at snake.Snake.make_snake(Snake.java:52)
at snake.Snake.<init>(Snake.java:34)
at snake.Snake.main(Snake.java:23)
ok then what should i do for black background as i said on blank frame setting the background doest'nt works wy my lat question i till unanswered...ye saw your post
means acctually i want to know how will i add the graphic object to frame as add methood takes component type of object.
no we are'nt in same class and acctually i want to make the background black but directly doing setBackground method does'nt do so why I dont know means in a blank frame when i set color of the background nothing happens so i made graphic object and when i set color then every object made using it will have that color so I did what actually happens can you tell me and what should I do to make this thing run..??