forked from Jared-Adamson/CSE_Java_Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment6.java
More file actions
38 lines (29 loc) · 1.08 KB
/
Assignment6.java
File metadata and controls
38 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Name: Jared Adamson
// Description: The Assignment 6 class creates a Tabbed Pane with
// two tabs, one for Account creation and one for
// Account transfer.
import javax.swing.*;
import java.util.*;
public class Assignment6 extends JApplet
{
private int APPLET_WIDTH = 500, APPLET_HEIGHT = 200;
private JTabbedPane tPane;
private CreatePanel createPanel;
private TransferPanel transferPanel;
private Vector accountList;
//The method init initializes the Applet with a Pane with two tabs
public void init()
{
//list of accounts to be used in every panel
accountList = new Vector();
//register panel uses the list of accounts
transferPanel = new TransferPanel(accountList);
createPanel = new CreatePanel(accountList, transferPanel);
//create a tabbed pane with two tabs
tPane = new JTabbedPane();
tPane.addTab("Account creation", createPanel);
tPane.addTab("Account transfer", transferPanel);
getContentPane().add(tPane);
setSize (APPLET_WIDTH, APPLET_HEIGHT); //set Applet size
}
}