Arraycopy method public static void arraycopy object

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: originalArray) 1 2 3 4 5 3 2 1 Array that was passed in 5 4 Array that we created with recursive function calls System.arraycopy() method public static void arraycopy( Object src, int srcPos, Object dest, int destPos, int length) •  You may find it useful for passing arrays from one call to the next •  Look it up in the Java API o  (if you haven’t been using it much by now, this tool is a great resource!) Null Pointer Exception case Make sure that the last two tests in the tester pass with “SUCCESS: No NullPointerException thrown.” message by dealing with null array input in your two reverse() methods. The key point here is that you do not manipulate the null object passed in as array in your reverse methods, but immediately return. If you do not deal with this special corner case, the last two tests will print “FAIL: NullPointerException – Fix me!”. Slots DEMO TIME! Slots Layout JPanel, JLabel Slots (Image, FramedRect, dynamically check location) JPanel, JButton How to Start •  READ INSTRUCTIONS •  Copy over images to your pa6 directory •  objectdraw.jar vs •  Separate responsibilities of the slot machine and the wheels •  The Slots controller takes input from the user and tells the SlotWheel object what to do •  Make SlotWheels listen to spinButton by adding action listeners Helpful constants for From the write-up: private private private private private private static final int NUM_OF_IMAGES = 8; static final double IMAGE_WIDTH = 110; static final double IMAGE_HEIGHT = 145; static final double WHEELS_Y_OFFSET = 5; static final double SPACE_BETWEEN_WHEELS = 5; static final int WHEEL_1_TICKS = 22; private private private private private static final int WHEEL_2_TICKS = WHEEL_...
View Full Document

This note was uploaded on 03/13/2014 for the course CSE 11 taught by Professor Staff during the Spring '08 term at UCSD.

Ask a homework question - tutors are online