Java The Complete Reference, Seventh Edition
// Get the HttpSession object. HttpSession hs = request.getSession(true); // Get writer. response.setContentType("text/html"); P ...
IV Applying Java CHAPTER 32 Financial Applets and Servlets CHAPTER 33 Creating a Download Manager in Java APPENDIX Using Java's ...
This page intentionally left blank ...
931 32 Financial Applets and Servlets D espite all the large, sophisticated applications, such as word processors, databases, an ...
932 Part IV: Applying Java Finding the Payments for a Loan Perhaps the most popular financial calculation is the one that comput ...
Chapter 32: Financial Applets and Servlets 933 } } // Set up and initialize the GUI. private void makeGUI() { // Use a grid bag ...
934 Part IV: Applying Java gbc.gridwidth = GridBagConstraints.REMAINDER; gbag.setConstraints(paymentText, gbc); gbc.anchor = Gri ...
} catch (NumberFormatException exc) { showStatus("Invalid Data"); paymentText.setText(""); } } // Compute the loan payment. doub ...
936 Part IV: Applying Java RegPaythen declares threedoublevariables that hold the loan values. The original principal is stored ...
Chapter 32: Financial Applets and Servlets 937 amountText = new JTextField(10); periodText = new JTextField(10); paymentText = n ...
938 Part IV: Applying Java Next, thegbc.gridwidthis set toREMAINDER, andgbc.anchoris set toNORTH. The label referred to byheadin ...
Chapter 32: Financial Applets and Servlets 939 After declaring theresultvariable,actionperformed( )begins by obtaining the strin ...
940 Part IV: Applying Java Finding the Future Value of an Investment Another popular financial calculation finds the future valu ...
Chapter 32: Financial Applets and Servlets 941 double principal; // original principal double rateOfRet; // rate of return doubl ...
942 Part IV: Applying Java // Anchor most components to the right. gbc.anchor = GridBagConstraints.EAST; gbc.gridwidth = GridBag ...
Chapter 32: Financial Applets and Servlets 943 nf.setMaximumFractionDigits(2); } /* User pressed Enter on a text field or presse ...
944 Part IV: Applying Java The formula to compute an initial investment is shown here: Initial Investment =targetValue/ (((rateO ...
Chapter 32: Financial Applets and Servlets 945 public void init() { try { SwingUtilities.invokeAndWait(new Runnable () { public ...
946 Part IV: Applying Java gbag.setConstraints(targetLab, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; gbag.setConstraint ...
Chapter 32: Financial Applets and Servlets 947 or pressed Compute. Display the result if all fields are completed. */ public voi ...
«
44
45
46
47
48
49
50
51
52
53
»
Free download pdf