0% found this document useful (0 votes)
5 views5 pages

Project Java Synopsis

The document is a Java class for an electricity billing system that extends JFrame and implements ActionListener. It sets up a graphical user interface with a menu bar containing options for managing customers, billing, and utilities. The class also handles user actions to perform various operations like adding new customers, calculating bills, and launching external applications like Notepad and Calculator.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Project Java Synopsis

The document is a Java class for an electricity billing system that extends JFrame and implements ActionListener. It sets up a graphical user interface with a menu bar containing options for managing customers, billing, and utilities. The class also handles user actions to perform various operations like adding new customers, calculating bills, and launching external applications like Notepad and Calculator.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Electricity-Billing-System\src\electricity\billing\system\Project.

java

1 package [Link];
2
3 import [Link].*;
4 import [Link].*;
5 import [Link].*;
6
7 public class Project extends JFrame implements ActionListener{
8
9 String atype, meter;
10 Project(String atype, String meter) {
11 [Link] = atype;
12 [Link] = meter;
13 setExtendedState(JFrame.MAXIMIZED_BOTH);
14
15 ImageIcon i1 = new ImageIcon([Link]("icon/[Link]"));
16 Image i2 = [Link]().getScaledInstance(1550, 850, Image.SCALE_DEFAULT);
17 ImageIcon i3 = new ImageIcon(i2);
18 JLabel image = new JLabel(i3);
19 add(image);
20
21 JMenuBar mb = new JMenuBar();
22 setJMenuBar(mb);
23
24 JMenu master = new JMenu("Master");
25 [Link]([Link]);
26
27
28 JMenuItem newcustomer = new JMenuItem("New Customer");
29 [Link](new Font("monospaced", [Link], 12));
30 [Link]([Link]);
31 ImageIcon icon1 = new ImageIcon([Link]("icon/[Link]"));
32 Image image1 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
33 [Link](new ImageIcon(image1));
34 [Link]('D');
35 [Link](this);
36 [Link]([Link](KeyEvent.VK_D,
ActionEvent.CTRL_MASK));
37 [Link](newcustomer);
38
39 JMenuItem customerdetails = new JMenuItem("Customer Details");
40 [Link](new Font("monospaced", [Link], 12));
41 [Link]([Link]);
42 ImageIcon icon2 = new ImageIcon([Link]("icon/[Link]"));
43 Image image2 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
44 [Link](new ImageIcon(image2));
45 [Link]('M');
46 [Link](this);
47 [Link]([Link](KeyEvent.VK_M,
ActionEvent.CTRL_MASK));
48 [Link](customerdetails);
49
50 JMenuItem depositdetails = new JMenuItem("Deposit Details");
51 [Link](new Font("monospaced", [Link], 12));
52 [Link]([Link]);
53 ImageIcon icon3 = new ImageIcon([Link]("icon/[Link]"));
54 Image image3 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
55 [Link](new ImageIcon(image3));
56 [Link]('N');
57 [Link](this);
58 [Link]([Link](KeyEvent.VK_N,
ActionEvent.CTRL_MASK));
59 [Link](depositdetails);
60
61 JMenuItem calculatebill = new JMenuItem("Calculate Bill");
62 [Link](new Font("monospaced", [Link], 12));
63 [Link]([Link]);
64 ImageIcon icon4 = new ImageIcon([Link]("icon/[Link]"));
65 Image image4 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
66 [Link](new ImageIcon(image4));
67 [Link]('B');
68 [Link](this);
69 [Link]([Link](KeyEvent.VK_B,
ActionEvent.CTRL_MASK));
70 [Link](calculatebill);
71
72 JMenu info = new JMenu("Information");
73 [Link]([Link]);
74
75
76 JMenuItem updateinformation = new JMenuItem("Update Information");
77 [Link](new Font("monospaced", [Link], 12));
78 [Link]([Link]);
79 ImageIcon icon5 = new ImageIcon([Link]("icon/[Link]"));
80 Image image5 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
81 [Link](new ImageIcon(image5));
82 [Link]('P');
83 [Link](this);
84 [Link]([Link](KeyEvent.VK_P,
ActionEvent.CTRL_MASK));
85 [Link](updateinformation);
86
87 JMenuItem viewinformation = new JMenuItem("View Information");
88 [Link](new Font("monospaced", [Link], 12));
89 [Link]([Link]);
90 ImageIcon icon6 = new ImageIcon([Link]("icon/[Link]"));
91 Image image6 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
92 [Link](new ImageIcon(image6));
93 [Link]('L');
94 [Link](this);
95 [Link]([Link](KeyEvent.VK_L,
ActionEvent.CTRL_MASK));
96 [Link](viewinformation);
97
98 JMenu user = new JMenu("User");
99 [Link]([Link]);
100
101
102 JMenuItem paybill = new JMenuItem("Pay Bill");
103 [Link](new Font("monospaced", [Link], 12));
104 [Link]([Link]);
105 ImageIcon icon7 = new ImageIcon([Link]("icon/[Link]"));
106 Image image7 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
107 [Link](new ImageIcon(image7));
108 [Link]('R');
109 [Link](this);
110 [Link]([Link](KeyEvent.VK_R,
ActionEvent.CTRL_MASK));
111 [Link](paybill);
112
113 JMenuItem billdetails = new JMenuItem("Bill Details");
114 [Link](new Font("monospaced", [Link], 12));
115 [Link]([Link]);
116 ImageIcon icon8 = new ImageIcon([Link]("icon/[Link]"));
117 Image image8 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
118 [Link](new ImageIcon(image8));
119 [Link]('B');
120 [Link](this);
121 [Link]([Link](KeyEvent.VK_B,
ActionEvent.CTRL_MASK));
122 [Link](billdetails);
123
124 JMenu report = new JMenu("Report");
125 [Link]([Link]);
126
127
128 JMenuItem generatebill = new JMenuItem("Generate Bill");
129 [Link](new Font("monospaced", [Link], 12));
130 [Link]([Link]);
131 ImageIcon icon9 = new ImageIcon([Link]("icon/[Link]"));
132 Image image9 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
133 [Link](new ImageIcon(image9));
134 [Link]('G');
135 [Link](this);
136 [Link]([Link](KeyEvent.VK_G,
ActionEvent.CTRL_MASK));
137 [Link](generatebill);
138
139 JMenu utility = new JMenu("Utility");
140 [Link]([Link]);
141
142
143 JMenuItem notepad = new JMenuItem("Notepad");
144 [Link](new Font("monospaced", [Link], 12));
145 [Link]([Link]);
146 ImageIcon icon10 = new
ImageIcon([Link]("icon/[Link]"));
147 Image image10 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
148 [Link](new ImageIcon(image10));
149 [Link]('N');
150 [Link](this);
151 [Link]([Link](KeyEvent.VK_N,
ActionEvent.CTRL_MASK));
152 [Link](notepad);
153
154 JMenuItem calculator = new JMenuItem("Calculator");
155 [Link](new Font("monospaced", [Link], 12));
156 [Link]([Link]);
157 ImageIcon icon11 = new ImageIcon([Link]("icon/[Link]"));
158 Image image11 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
159 [Link](new ImageIcon(image10));
160 [Link]('C');
161 [Link](this);
162 [Link]([Link](KeyEvent.VK_C,
ActionEvent.CTRL_MASK));
163 [Link](calculator);
164
165 JMenu mexit = new JMenu("Exit");
166 [Link]([Link]);
167
168
169 JMenuItem exit = new JMenuItem("Exit");
170 [Link](new Font("monospaced", [Link], 12));
171 [Link]([Link]);
172 ImageIcon icon12 = new
ImageIcon([Link]("icon/[Link]"));
173 Image image12 = [Link]().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
174 [Link](new ImageIcon(image12));
175 [Link]('W');
176 [Link](this);
177 [Link]([Link](KeyEvent.VK_W, ActionEvent.CTRL_MASK));
178 [Link](exit);
179
180 if ([Link]("Admin")) {
181 [Link](master);
182 } else {
183 [Link](info);
184 [Link](user);
185 [Link](report);
186 }
187
188 [Link](utility);
189 [Link](mexit);
190
191 setLayout(new FlowLayout());
192
193 setVisible(true);
194 }
195
196 public void actionPerformed(ActionEvent ae) {
197 String msg = [Link]();
198 if ([Link]("New Customer")) {
199 new NewCustomer();
200 } else if ([Link]("Customer Details")) {
201 new CustomerDetails();
202 } else if ([Link]("Deposit Details")) {
203 new DepositDetails();
204 } else if ([Link]("Calculate Bill")) {
205 new CalculateBill();
206 } else if ([Link]("View Information")) {
207 new ViewInformation(meter);
208 } else if ([Link]("Update Information")) {
209 new UpdateInformation(meter);
210 } else if ([Link]("Bill Details")) {
211 new BillDetails(meter);
212 } else if ([Link]("Notepad")) {
213 try {
214 [Link]().exec("[Link]");
215 } catch (Exception e) {
216 [Link]();
217 }
218 } else if ([Link]("Calculator")) {
219 try {
220 [Link]().exec("[Link]");
221 } catch (Exception e) {
222 [Link]();
223 }
224 } else if ([Link]("Exit")) {
225 setVisible(false);
226 new Login();
227 } else if ([Link]("Pay Bill")) {
228 new PayBill(meter);
229 } else if ([Link]("Generate Bill")) {
230 new GenerateBill(meter);
231 }
232 }
233
234 public static void main(String[] args) {
235 new Project("", "");
236 }
237 }
238

You might also like