Write a small application with a GUI that could be the basis of a larger application. Your application should accept a credit card number entered into a text field. When the user clicks an Accept button, you should check whether the number entered contains exactly 16 digits. If so, display the message Number accepted: as well as the card number in a label, and then clear the text field. If not, display the message Number rejected in the label. (Note: Credit card numbers have fancier format requirements that depend on the issuer of the card and are beyond the scope of this exercise.)

What will be an ideal response?


See the code in Exercise11.java, CreditCardWindow.java.

Computer Science & Information Technology

You might also like to view...

The ____ vulnerability exploits an unchecked buffer in Internet Explorer processing HTML elements such as FRAME and IFRAME elements.?

A. ?phishing B. ?buffer overflow C. ?HTML e-mail D. ?remote access

Computer Science & Information Technology

Key studies reveal that the overriding factor in leveling the ethical perceptions within a small population is __________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A role is defined as a collection of related computer system operations that can be performed by users of that system.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following is a common location of the CMOS battery in a laptop?

A. Under the keyboard B. Behind the removable hard drive C. Under the removable CD drive D. Behind the laptop battery

Computer Science & Information Technology