thattacoguy

CommissionApplet == INCOMPLETE

Aug 15th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.98 KB | None | 0 0
  1. /*
  2.     Chapter 4:      Sales Commission
  3.     Programmer:         K. Klug
  4.     Date:           August 14, 2013
  5.     Filename:       Commission.java
  6.     Purpose:        This applet calculates sales commission using a sales amount
  7.                     (input by the user) and a sales code (chosen from among option buttons).
  8. */
  9.  
  10. import java.awt*;
  11. import java.applet.*;
  12. import java.awt.event.*;
  13. import java.text.DecimalFormat;
  14.  
  15. public class CommissionApplet extends Applet implements ItemListener
  16. {
  17.     //declare variables and construct a color
  18.     double dollars, answer;
  19.     int empCode;
  20.     Image dollarSign;
  21.     Color darkRed = new Color(160, 50, 0);
  22.    
  23.     //Create components for applet
  24.     Label promptLabel = new Label("Enter the sales amount (do not use commas or dollar signs):")
  25.         TextField salesField = new TextField(20);
  26.        
  27.     Label codeLabel = new Label("Select the appropriate commission code:");
  28.    
  29.     CheckboxGroup codeGroup = new CheckboxGroup();
  30.         Checkbox telephonebox = new Checkbox("Telephone Sales",false,codeGroup);
  31.         Checkbox inStoreBox = new Checkbox("In-Store Sales",false,codeGroup);
  32.         Checkbox outsideBox = new Checkbox("Outside Sales",false,codeGroup);
  33.         Checkbox hiddenBox = new Checkbox("",true,codeGroup);
  34.        
  35.     Label outputLabel = new Label("Click an option button to calculate the sales commission.");
  36.    
  37.         public void init()
  38.     {
  39.         setBackground(darkRed);
  40.         setForeground(Color.white);
  41.         add(promptLabel);
  42.         add(salesField);
  43.         salesField.requestFocus();
  44.         salesField.setForeground(Color.black);
  45.         add(codeLabel);
  46.         add(telephoneBox);
  47.         telephoneBox.addItemListener(this);
  48.         add(inStoreBox);
  49.         inStoreBox.addItemListener(this);
  50.         add(outsideBox);
  51.         outsideBox.addItemListener(this);
  52.         add(outputLabel);
  53.     }
  54.    
  55.     //This method is triggered by the user clicking an option button
  56.     public void itemStateChanged(ItemEvent choice)
  57.     }
  58.     {
  59. }
  60.  
  61.  
  62. ==================
  63.  
  64. Progressed until Page 273,
  65.  
  66. http://pastebin.com/YEqMuTiC is the containing code(?)
  67.  
  68. Stopped at Figure 4-46asjkbbbbbbbbbb
  69.  
  70. something.
  71.  
  72. idfk.
  73.  
  74. sleep.
  75.  
  76. i need it
Advertisement
Add Comment
Please, Sign In to add comment