Hi all,
I've wrote my code to where I have my string "I live for Java, no really" showing along with my 2 buttons labeled "Cut String" and "Restore String", but I'm having trouble with the functionality part of it. Meaning getting it to separate when I click "Cut String" and come back together when I click "Restore String" based on the requirements below. HELP! HELP! Any suggestions?
1. Add 2 buttons called cutStringButton and restoreStringButton in the window panel.
2. Draw an arbitrary string at location 100,100. The string has only 1 comma.
(For example “Welcome to Dallas, enjoy your stay”)
3. When cutStringButton is clicked, the string above is cut to 2 parts, separated by the comma. (Comma is not included in the separated strings). The first part is printed at location (100,100), and the second part is printed at location (100,120).
(Hint, you should use indexOf() find the location of the comma.)
4. When restoreStringButton is clicked, the string is restored to the original