Write a complete program named Buttons that implements a window with three buttons – left, blue, and reset. When the left button is clicked, the window’s contents (the three buttons) shifts left. When the blue button is clicked, the window’s background color changes to blue. When the reset button is clicked, the window’s contents shifts back to the original center alignment and the window’s background color changes back to its original color.

In implementing the reset functionality, don’t try to figure out a color constant that’s used for the window’s original color value. That’s counterproductive because the color might be different on different computers. Instead, retrieve and save the window’s original color and then when the color needs to be reset, use that saved original color value.

As always:

  • Limit your use of class variables and instance variables – only use them if appropriate.
  • Use appropriate modifiers for your methods. The modifiers we’ve discussed are private, public, protected, static, and final.
  • Use helping methods if appropriate.
  • Mimic the sample session precisely. In particular, note the window’s title, the window’s size, and the positions of components.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.