Jeffrey Rodriguez - UCSC Homework Page

December 2nd, 1999

Homework # 4-  Same as homework 3 but a Swing JApplet

  

 

Source  Calculatorx.java  StringDisplay.java 

Features:

  1. Numbers display right to left in text field ( I rewrote this applet from label to text field).
  2. Input must be valid for current base. ( To change from base to base press delete key or CA button) first.
  3. Invalid number/input should not appear. The invalid input is ignored.
  4. If move cursor and type should move to outer right.
  5. Delete key  removed last digit typed.
  6. Clicking button inputs enter the corresponding digits.
  7. Clear (CA) key clear the display. Clr just acts as the backspace key.
  8. Number of digits enter per number base is checked. If more than allowed digits you get error message.
  9. handles the decimal point.
  10. Disables the buttons that are invalid for the current base.
  11. Display "0" upon startup
  12. Display "0" upon Clr, AC, Deletion of last non-zero key.
  13. Handles regaining focus to JText from JButton

 

 

 

 

Hosted by www.Geocities.ws

1