Documente Academic
Documente Profesional
Documente Cultură
Date;
public FeesReceipt() {
initComponents();
@SuppressWarnings("unchecked")
jR = new javax.swing.JButton();
jButton2.setText("Generate Receipt");
jButton3.setText("Generate Receipt");
jButton5.setText("Generate Receipt");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jGR.setText("Generate Receipt");
jGR.addActionListener(new java.awt.event.ActionListener() {
jGRActionPerformed(evt);
}
});
jR.setText("Reset");
jR.addActionListener(new java.awt.event.ActionListener() {
jRActionPerformed(evt);
});
jPR.setText("Print Receipt");
jPR.addActionListener(new java.awt.event.ActionListener() {
jPRActionPerformed(evt);
});
Area.setEditable(false);
Area.setColumns(20);
Area.setRows(5);
jScrollPane1.setViewportView(Area);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(19, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addComponent(lStudentName)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lFeesAmount, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lFatherMoblie, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lBatchTiming, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lFatherName, javax.swing.GroupLayout.Alignment.LEADING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tFatherName, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tBatchTiming, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tFatherMobile, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tFeesAmount, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addComponent(jGR)
.addComponent(jR)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPR)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31,
Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(lTitle)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(lTitle)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lStudentName)
.addComponent(tStudentName, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lFatherName)
.addComponent(tFatherName, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lBatchTiming)
.addComponent(tBatchTiming, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lFatherMoblie)
.addComponent(tFatherMobile, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lFeesAmount)
.addComponent(tFeesAmount, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jGR)
.addComponent(jR)
.addComponent(jPR))))
.addContainerGap(21, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
Area.setText(Area.getText()+"***************************************************\n");
Area.setText(Area.getText()+"\n"+date+"\n\n");
Area.setText("");
tStudentName.setText("");
tFatherName.setText("");
tBatchTiming.setText("");
tFatherMobile.setText("");
tFeesAmount.setText("");
try{
Area.print();
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(FeesReceipt.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(FeesReceipt.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(FeesReceipt.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.awt.EventQueue.invokeLater(new Runnable() {
new FeesReceipt().setVisible(true);
});
}
Figure 1: GUI of the Fees Receipt Program (without data inserted)
Figure 2: Shows the Inputs in the program as well as the result after clicking the “Generate Receipt”
button.
Figure 3: After clicking the “Reset” button.