![]() * Toggle whether the decrease in a row length is symmetric. * Toggle whether the wall is multicoloured. Public BrickWall(Integer rows, Integer rowLen) * isSymmetric if decrease is greater than 0 and isSymmetric is true the wall is a pyramid shape, otherwise it is a rectangle or a right angle triangle. * decrease If true subtract 2 from rowLen for each row drawn When true the colours cycle through the 6 colours. * isMultiColor when false all bricks are the same colour. * rowlen The maximum number of bricks in a row * Constructor for objects of class BrickWall. * Create a new rectangle object representing a brick and add it to the arraylist. Beneath the methods you will find the rest of the code of the whole class. So how do I place them next to each other? See my two methods down here. ![]() I have managed to get one brick to be shown but they need to be placed next to eachother. My question is how can I create a row of 8 bricks. I have written the following code for the above two methods. ![]() Rectangle object representing the brick should be added to the ArrayList called Eachīrick should be created as a Rectangle object, 54 pixels wide and 16 pixels high. Should create a new Rectangle object at the position (X,Y) and make it visible. It`s about this question: "You will probably find it easier to write the code toĭraw your wall if you first write a private method called drawRow which draws a row of nīricks starting at coordinates (x, y). I have the following question which has to do with my homework for Java. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |