Download presentation
Presentation is loading. Please wait.
1
Savings Account From Learn Java GUI
2
Console App Sample Data Input: Monthly deposit amount: 100
Annual interest rate: 10 Number of months: 12 Output: Final Balance:
3
GUI App For the SavingsAccount GUI app, we will use a GridBagLayout manager to create a final screen that looks like this:
4
How many columns and how many rows?
5
Begin typing this code:
Class Declaration } Constructor
6
setVisible(true); Main Method WindowListener Event
7
Controls Declare and add the 10 controls as class objects.
Hint: JLabel depositLabel=new JLabel();
8
Controls Position and add each control by
creating a GridBagConstraints object setting the text, if necessary setting the gridx and gridy setting column size, if necessary adding each item to the contentPane adding actionListenters to the 2 buttons packing the items onto the form
9
actionListener
10
actionPerformed Methods
11
Code Code the calcBtnActionPerformed event
Code the exitBtnActionPerformed event You’re Done! – All code on p 135 of the pdf in the book
12
Flash Cards Practice the skills you just went through by writing an app that generates random addition (or more) problems. Provide feedback to the user and a scoring system.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.