-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWelcome_Screen.java
More file actions
58 lines (40 loc) · 1.52 KB
/
Welcome_Screen.java
File metadata and controls
58 lines (40 loc) · 1.52 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/*****************************************************************************************************
* Represents an instance of a main menu to display on the JFrame.
*****************************************************************************************************/
public class Welcome_Screen extends JPanel
{
/* Pointer to the main java window to access its get() methods for other panels */
//protected Loan_Calculator_Frame outer_frame;
/* Panels displaying different options to the user */
private Background_Panel background;
/*********************************************************************************
* Main constructor used when creating a main menu.
*********************************************************************************/
public Welcome_Screen(Background_Panel outerPanel)
{
//setLayout(new GridLayout(2, 4));
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
// establish a reference to the frame to change the displayed panel
this.background = outerPanel;
add(new Centered_Text_Panel("Welcome to Loan Calculator"));
add(new Continue_Button());
//add(insert_delete_panel = new Update_Panel());
}
private class Continue_Button extends JButton
{
public Continue_Button()
{
super("Continue ->");
addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
background.changeCurrentPanel(new Loan_Screen(background));
}
});
}
}
} // end Welcome_Screen class