Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
selfcheckout2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
paolo.tokam
selfcheckout2
Commits
812ecda8
Commit
812ecda8
authored
Apr 15, 2021
by
paolo.tokam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
334 additions
and
0 deletions
+334
-0
COM4001M_Paolo_Tokam
COM4001M_Paolo_Tokam
+334
-0
No files found.
COM4001M_Paolo_Tokam
0 → 100644
View file @
812ecda8
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author paolo2002
*/
public class paolotokam extends javax.swing.JFrame {
double totalcost = 0;
double applePrice = 1;
int appleQty = 20;
String appleName= "Apple";
double orangePrice = 1;
int orangeQty = 20;
String orangeName= "Orange";
double bananaPrice = 1;
int bananaQty = 20;
String bananaName= "Banana";
double drinkPrice = 1;
int drinkQty = 20;
String drinkName= "Drink";
double snackprice = 2;
int snackQty = 20;
String snackName= "Snack";
double sweetPrice = 2;
int sweetQty = 20;
String sweetName= "Sweet";
double chocolatePrice = 2;
int chocolateQty = 20;
String chocolateName= "Chocolate";
double biscuitPrice = 2;
int biscuitQty = 20;
String biscuitName= "Biscuit";
double cakePrice = 2;
int cakeQty = 20;
String cakeName= "Cake";
/**
* Creates new form paolotokam
*/
public paolotokam() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
selections = new javax.swing.JComboBox<>();
jScrollPane1 = new javax.swing.JScrollPane();
products = new javax.swing.JTextArea();
jTextField1 = new javax.swing.JTextField();
qty = new javax.swing.JLabel();
Itemlist = new javax.swing.JButton();
QTY = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
discount = new javax.swing.JLabel();
payment = new javax.swing.JTextField();
info = new javax.swing.JLabel();
successfull = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
Add = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
yes = new javax.swing.JButton();
No = new javax.swing.JButton();
confirm = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
selections.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
selections.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Apple (£1)", "Orange (£1)", "Banana (£1)", "Drink (£1)", "Snack(£2)", "Sweet(£2)", "Chocolate (£2)", "Biscuit (£2)", "Cake (£2)" }));
products.setColumns(20);
products.setRows(5);
jScrollPane1.setViewportView(products);
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
qty.setText("Qty");
Itemlist.setText("Add");
Itemlist.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ItemlistActionPerformed(evt);
}
});
QTY.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
QTY.setText("Deduction");
QTY.setActionCommand("provide Deduction");
QTY.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
QTYActionPerformed(evt);
}
});
discount.setText("Discount");
payment.setText("Payment ");
info.setText("Enter payment info here");
successfull.setText("Payment successfull!!!");
jLabel6.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
jLabel6.setText("Welcome to checkout :)");
jLabel7.setText("Thank You :)");
Add.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
Add.setForeground(new java.awt.Color(0, 204, 0));
Add.setText("Add");
jLabel8.setText("Would you like your receipt ?");
yes.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
yes.setForeground(new java.awt.Color(0, 204, 0));
yes.setText("Yes");
No.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
No.setForeground(new java.awt.Color(255, 0, 0));
No.setText("No");
No.setActionCommand("No");
confirm.setFont(new java.awt.Font("Lucida Grande", 1, 12)); // NOI18N
confirm.setForeground(new java.awt.Color(0, 204, 0));
confirm.setText("Confirm");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(119, 119, 119))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(45, 45, 45)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(selections, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(qty))
.addGroup(layout.createSequentialGroup()
.addGap(23, 23, 23)
.addComponent(Itemlist))))
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(info)
.addComponent(confirm))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(payment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(QTY)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(discount))))))
.addGroup(layout.createSequentialGroup()
.addGap(212, 212, 212)
.addComponent(jLabel2))
.addGroup(layout.createSequentialGroup()
.addGap(210, 210, 210)
.addComponent(Add))
.addGroup(layout.createSequentialGroup()
.addGap(115, 115, 115)
.addComponent(jLabel6))
.addGroup(layout.createSequentialGroup()
.addGap(124, 124, 124)
.addComponent(jLabel7))
.addGroup(layout.createSequentialGroup()
.addGap(79, 79, 79)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(yes)
.addGap(31, 31, 31)
.addComponent(No))))
.addGroup(layout.createSequentialGroup()
.addGap(96, 96, 96)
.addComponent(successfull)))
.addContainerGap(111, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(selections, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(qty)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(Itemlist))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Add, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(QTY)
.addComponent(discount))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(payment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(info))
.addGap(31, 31, 31))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(confirm)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addComponent(successfull, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(yes)
.addComponent(No))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2))
);
discount.getAccessibleContext().setAccessibleName("discount");
pack();
}// </editor-fold>
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void ItemlistActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void QTYActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(paolotokam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(paolotokam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(paolotokam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(paolotokam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new paolotokam().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton Add;
private javax.swing.JButton Itemlist;
private javax.swing.JButton No;
private javax.swing.JButton QTY;
private javax.swing.JButton confirm;
private javax.swing.JLabel discount;
private javax.swing.JLabel info;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField payment;
private javax.swing.JTextArea products;
private javax.swing.JLabel qty;
private javax.swing.JComboBox<String> selections;
private javax.swing.JLabel successfull;
private javax.swing.JButton yes;
// End of variables declaration
}
//Get the quantity from the user
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment