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

Java Programming

If you are looking for a Sample assignment of Java Programming, I propose you check out Programming Assignments for what they have done. https://www.programmingassignments.com/java-homework-help/ There are no regrets once you get assistance from them.

Uploaded by

Franklin Deo
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)
24 views5 pages

Java Programming

If you are looking for a Sample assignment of Java Programming, I propose you check out Programming Assignments for what they have done. https://www.programmingassignments.com/java-homework-help/ There are no regrets once you get assistance from them.

Uploaded by

Franklin Deo
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
You are on page 1/ 5

Stock Control program in java

This program is for controlling the stock. User can perform several
actions like- checking stock , adding stock, verification of password,
purchasing item, and updating stock.

/*
* 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.
*/
package stockcontrolsimulation;

/**
*
* @author walid
*/
public class Master extends javax.swing.JFrame {

/**
* Creates new form Master
*/
public Master() {
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">//GEN-BEGIN:initComponents
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


lblTitle = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
btncheckStock = new javax.swing.JButton();
btnPurchaseItem = new javax.swing.JButton();
btnUpdateStock = new javax.swing.JButton();
btnExit = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
lblTitle.setFont(new java.awt.Font("Tahoma", 1, 12)); //
NOI18N
lblTitle.setText("Select an option by clicking one of the
buttons below");
lblTitle.setPreferredSize(new java.awt.Dimension(332, 20));
jPanel1.add(lblTitle);

getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);

btncheckStock.setText("Check stock");
btncheckStock.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
btncheckStockActionPerformed(evt);
}
});
jPanel2.add(btncheckStock);

btnPurchaseItem.setText("Purchase item");
btnPurchaseItem.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
btnPurchaseItemActionPerformed(evt);
}
});
jPanel2.add(btnPurchaseItem);

btnUpdateStock.setText("Update stock");
btnUpdateStock.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
btnUpdateStockActionPerformed(evt);
}
});
jPanel2.add(btnUpdateStock);

btnExit.setText("Exit");
btnExit.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent
evt) {
btnExitActionPerformed(evt);
}
});
jPanel2.add(btnExit);

getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents

private void btnExitActionPerformed(java.awt.event.ActionEvent


evt) {//GEN-FIRST:event_btnExitActionPerformed

//When exit button clicked, close the application


System.exit(0);
}//GEN-LAST:event_btnExitActionPerformed

private void
btncheckStockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_btncheckStockActionPerformed
//when button check Stock clicked display the checkStock
JFrame
(new CheckStock()).setVisible(true);
}//GEN-LAST:event_btncheckStockActionPerformed

private void
btnPurchaseItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_btnPurchaseItemActionPerformed
// Display PurchaseItem JFrame
new PurchaseItem().setVisible(true);
}//GEN-LAST:event_btnPurchaseItemActionPerformed

private void
btnUpdateStockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_btnUpdateStockActionPerformed
// // Display PasswordVerif JFrame
new PasswordVerif().setVisible(true);
}//GEN-LAST:event_btnUpdateStockActionPerformed

//The Main function

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Java look and feel */
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels())
{
if ("Java".equals(info.getName()))
{

javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Master.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Master.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Master.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Master.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Master().setVisible(true);
}
});
}

// Variables declaration - do not modify//GEN-BEGIN:variables


private javax.swing.JButton btnExit;
private javax.swing.JButton btnPurchaseItem;
private javax.swing.JButton btnUpdateStock;
private javax.swing.JButton btncheckStock;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lblTitle;
// End of variables declaration//GEN-END:variables
}

Contacts

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy