Your assignment for this lesson is to write a GUI program that will use a button to count down from five to zero. When i

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Your assignment for this lesson is to write a GUI program that will use a button to count down from five to zero. When i

Post by answerhappygod »

Your Assignment For This Lesson Is To Write A Gui Program That Will Use A Button To Count Down From Five To Zero When I 1
Your Assignment For This Lesson Is To Write A Gui Program That Will Use A Button To Count Down From Five To Zero When I 1 (174.41 KiB) Viewed 24 times
Your assignment for this lesson is to write a GUI program that will use a button to count down from five to zero. When it reaches zero, it should display a label indicating the end of the count. Each click should decrease the number by one. For example, when the program starts the button will say "Five" or "5." After the first click, it will say "Four" or "4," and so on. When it gets to zero, the button should be replaced by a label with a message in it. The text in the label can say anything you like. There are two things you will need to use that we did not discuss in the lesson. You will need to be able to find out what text was on the button when it was clicked. You can do that with the button's getText() method. You will also need to know how to make a button disappear so you can see the label. A button has a setVisible() method just like a frame does. To make the button disappear, call its setVisible() method with an argument of false.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply