Question: mport java.awt. * ; import java.awt.event. * ; import javax.swing. * ; public class Robot extends JFrame implements ActionListener { int x , max _
mport java.awt.; import java.awt.event.; import javax.swing.; public class Robot extends JFrame implements ActionListener int x maxx minx; JButton forwardButton, backwardButton, forwardXButton, backwardXButton; JTextArea displayTA; Container cp; Question Marks With regards to the above code: mark Set the maximum and minimum bounds using the values passed to the constructor. marks Assign the content pane to cp and assign it the FlowLayout layout manager. marks Create the four buttons and the text area objects. Make sure that the buttons have the appropriate text and that the text area has a width of characters. public static void mainString argsCreate an object Robot f new RobotRobot Movement", ; Make the object visible fsetVisibletrue; RobotString title, int newMax, int newMin Set maxx and minx Set up the Frame setTitletitle; setSize; setLocation; setDefaultCloseOperationEXITONCLOSE; Get content pane and assign layout manager Create and set up components Assign action listeners Add components to the content pane Methods to move robot backwards and forwards by one step Methods to move robot backwards and forwards by multiple steps set methods for bounds Method to check bounds have not been exceeded. Method to update the text area actionPerformed method
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
