Hello fellow Java scripters,
I have a question about object in array, and how to draw them.
Il try to explain this further now:
for example if i have a Clas Book(int xPos, int yPos)
i put this clas in an Array in the BookPanel as following:
Now in the draw(Graphics g) i put a for-loop
BookTabel = new Book
book = new Book(100,100)
book = new Book(200,200)
book = new Book(300,300)
so i need to draw these Books on the panel i have an other way of doing this but i need to do it with the array and the for loop.
public paintComponent(Graphics g)
for(x=0 ; x<= BookTabel.length ; x++)
/** How do i draw these objects in this paintcomponent??**/
How i draw a Book now is:
i declare and object of the book like this:
private Book book1;
book1 = new Book(int x, int y)
And draw it in the draw(Graphics g) like this:
Then it draws the book on screen with no problem.
So for short i need the code that draws the objects in the array with the for loop on screen.
because codes like book.draw(g); doenst work