ATM Management System Project in Java
منتدى مصر التقني :: قسم لغات البرمجة Programming languages :: لغة الجافا Java :: مشاريع مفتوحة المصدر Java App
صفحة 1 من اصل 1 • شاطر
ATM Management System Project in Java
1. Main Module
package atm;
import java.sql.SQLException;
public class Main {
public static void main(String[] args) throws InterruptedException, SQLException {
Login login = new Login();
login.loginView();
}
}
2. Login Module
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Login extends Commons{
public void loginView() {
Commons common = new Commons();
JFrame frame = (JFrame)common.Frame();
Font txt = new Font("", Font.BOLD, 15);
Pin pin = new Pin();
//---------------CARDNUMBER----------------
JLabel card = new JLabel("ENTER YOUR CARD NUMBER");
card.setBounds(50, 270, 250, 20);
card.setFont(txt);
JTextField cardNumber = new JTextField();
cardNumber.setBounds(50, 300, 500, 35);
cardNumber.setFont(txt);
frame.add(cardNumber);
frame.add(card);
//-----------------------------------------
//----------------ADMIN--------------------
JLabel admin = new JLabel("ADMIN LOGIN >");
admin.setBounds(0, 500, 570, 30);
admin.setHorizontalAlignment(JLabel.RIGHT);
admin.setFont(txt);
frame.add(admin);
admin.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
pin.pinView("admin");
frame.dispose();
}
});
//------------------------------------------
//-----------------BUTTON-----------------
JButton cont = new JButton("COUNTINUE");
cont.setBounds(200, 400, 200, 50);
cont.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(cont);
cont.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(cardNumber.getText().length() == 16) {
pin.pinView(cardNumber.getText());
frame.dispose();
}
else {
Fail fail = new Fail();
fail.failView("WRONG CARD NUMBER!!!");
frame.dispose();
}
}
});
//----------------------------------------
frame.setVisible(true);
}
}
3. Pin Checking Module
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
public class Pin {
public void pinView(String cardNum) {
Commons common = new Commons();
JFrame frame = (JFrame)common.Frame();
Font txt = new Font("", Font.BOLD, 15);
Home home = new Home();
Admin admin = new Admin();
//---------------PASSWORD----------------
JLabel pswd = new JLabel("ENTER YOUR PIN");
pswd.setBounds(50, 270, 250, 20);
pswd.setFont(txt);
JPasswordField pswdField = new JPasswordField();
pswdField.setBounds(50, 300, 500, 35);
pswdField.setFont(txt);
frame.add(pswdField);
frame.add(pswd);
//-----------------------------------------
//-----------------BUTTON-----------------
JButton cont = new JButton("COUNTINUE");
cont.setBounds(200, 400, 200, 50);
cont.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(cont);
cont.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
SQLManage man = new SQLManage();
ResultSet rst = man.check(cardNum, pswdField.getText());
if(rst.next()) {
if(rst.getString("card").equals("admin")) {
admin.adminView();
frame.dispose();
}
else {
home.homeView(rst.getInt("id"));
frame.dispose();
}
}
else {
Fail fail = new Fail();
fail.failView("WRONG PIN!!!");
frame.dispose();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
//----------------------------------------
frame.setVisible(true);
}
}
4. Admin home page
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Admin {
public void adminView() {
Commons commons = new Commons();
JFrame frame = (JFrame) commons.Frame();
//-------------ADDUSERS---------------------
JButton add = new JButton("ADD USERS");
add.setBounds(150, 250, 300, 100);
add.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(add);
add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
AddUser user = new AddUser();
try {
user.addView();
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
//------------------------------------------
//--------------EXIT---------------------------
JButton exit = new JButton("EXIT");
exit.setBounds(150, 400, 300, 100);
exit.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(exit);
exit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
//---------------------------------------------
frame.setVisible(true);
}
}
5. Module to add users
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.util.Random;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class AddUser {
JTextField pinField, atmField;
Random random = new Random();
public void addView() throws SQLException {
Commons commons = new Commons();
JFrame frame = (JFrame) commons.Frame();
Font txt = new Font("", Font.BOLD, 20);
SQLManage manage = new SQLManage();
Success success = new Success();
//--------------NAME--------------------
JLabel name = new JLabel("Name : ");
name.setBounds(50, 200, 100, 25);
name.setFont(txt);
JTextField nmField = new JTextField();
nmField.setBounds(50, 230, 500, 30);
frame.add(nmField);
frame.add(name);
//--------------------------------------
//-------------ATMNUMBER------------------
JLabel atmno = new JLabel("ATM Card Number : ");
atmno.setBounds(50, 300, 500, 25);
atmno.setFont(txt);
atmField = new JTextField();
atmField.setBounds(50, 330, 500, 30);
atmField.setEditable(false);
frame.add(atmField);
frame.add(atmno);
//----------------------------------------
//-------------ATMPIN------------------
JLabel atmpin = new JLabel("ATM Card PIN : ");
atmpin.setBounds(50, 400, 500, 25);
atmpin.setFont(txt);
pinField = new JTextField();
pinField.setBounds(50, 430, 200, 30);
pinField.setEditable(false);
frame.add(pinField);
frame.add(atmpin);
//----------------------------------------
//-------------BALANCE------------------
JLabel bal = new JLabel("BALANCE : ");
bal.setBounds(350, 400, 500, 25);
bal.setFont(txt);
JTextField balField = new JTextField();
balField.setBounds(350, 430, 200, 30);
frame.add(balField);
frame.add(bal);
//----------------------------------------
//--------------AUTOGENERATION----------------
auto();
//---------------------------------------------
//---------------SUBMIT-------------------
JButton sbmt = new JButton("SUBMIT");
sbmt.setBounds(200, 500, 200, 50);
frame.add(sbmt);
sbmt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(!nmField.getText().equals("")) {
if(balField.getText().equals(""))
balField.setText("0");
try {
manage.adding(atmField.getText(), pinField.getText(), nmField.getText(), balField.getText());
} catch (SQLException e1) {
e1.printStackTrace();
}
success.detailView(atmField.getText(), pinField.getText());
balField.setText("");
nmField.setText("");
auto();
}
}
});
//------------------------------------------
frame.setVisible(true);
}
public void auto() {
String str = "";
for(int i=0; i<16; i++) {
str += random.nextInt(9 - 0 + 1) + 0;
}
atmField.setText(str);
str = "";
for(int i=0; i<4; i++) {
str += random.nextInt(9 - 0 + 1) + 0;
}
pinField.setText(str);
}
}
6. Database Management Module
package atm;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class SQLManage {
Connection con;
SQLManage() throws SQLException {
String usr = "root";
String pass = "password";
String url = "jdbc:mysql://localhost:3306/atm";
con = DriverManager.getConnection(url, usr, pass);
}
public ResultSet check(String usr, String pass) throws SQLException {
String str = "SELECT * FROM users WHERE card = '"+ usr +"' AND pin = '"+ pass+ "'";
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery(str);
return rst;
}
public void deposit(int amt, int id) throws SQLException {
String str = "UPDATE users SET bal = bal + "+amt+" WHERE id = "+id;
Statement stm = con.createStatement();
stm.executeUpdate(str);
int bal = balCheck(id);
str = "INSERT INTO transactions (id, amount, stat, bal) VALUES("+id+", "+amt+", 'dep', "+bal+")";
Statement stm2 = con.createStatement();
stm2.executeUpdate(str);
}
public int withdraw(int amt, int id) throws SQLException {
int bal = balCheck(id);
if(bal >= amt) {
String str = "UPDATE users SET bal = bal - "+amt+" WHERE id = "+id;
Statement stm = con.createStatement();
stm.executeUpdate(str);
bal -= amt;
str = "INSERT INTO transactions (id, amount, stat, bal) VALUES("+id+", "+amt+", 'wit', "+bal+")";
Statement stm2 = con.createStatement();
stm2.executeUpdate(str);
return 1;
}
return 0;
}
public void pinchange(String pin, int id) throws SQLException {
String str = "UPDATE users SET pin = '"+pin+"' WHERE id = " + id;
Statement stm = con.createStatement();
stm.executeUpdate(str);
}
public int balCheck(int id) throws SQLException {
String str = "SELECT bal FROM users WHERE id = " + id;
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery(str);
rst.next();
return rst.getInt("bal");
}
public ResultSet stmt(int id) throws SQLException {
String str = "SELECT * FROM transactions WHERE id = " + id + " order by transid desc";
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery(str);
return rst;
}
public void adding(String card, String pin, String name, String bal) throws SQLException {
String str = "INSERT INTO users (card, pin, uname, bal) values ('" +card+ "', '"+pin+"', '"+name+"', "+bal+")";
Statement stm = con.createStatement();
stm.executeUpdate(str);
}
}
7. Common Frame and Logo
package atm;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Commons {
public Component Frame() {
JFrame frame = new JFrame();
frame.setSize(600, 600);
frame.setLocationRelativeTo(null);
frame.setLayout(null);
frame.setResizable(false);
frame.getContentPane().setBackground(Color.decode("#ADD8E6"));
//------------------LOGO----------------------------------
JLabel atm = new JLabel("ATM");
atm.setBounds(0, 30, 600, 120);
atm.setHorizontalAlignment(JLabel.CENTER);
atm.setFont(new Font("Monospaced", Font.BOLD, 120));
JLabel man = new JLabel("MANAGEMENT SYSTEM");
man.setBounds(0, 140, 600, 20);
man.setHorizontalAlignment(JLabel.CENTER);
man.setFont(new Font("Monospaced", Font.BOLD, 20));
frame.add(man);
frame.add(atm);
//-----------------------------------------------
return frame;
}
}
8. Success Page
package atm;
import java.awt.Font;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Success {
public void successView(int id) throws SQLException {
Home home = new Home();
Commons commons = new Commons();
JFrame frame =(JFrame) commons.Frame();
//-----------------SUCCESS------------------
JLabel sucss = new JLabel("TRANSACTION SUCCESS.");
sucss.setBounds(0, 280, 600, 50);
sucss.setHorizontalAlignment(JLabel.CENTER);
sucss.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(sucss);
//-----------------------------------------
home.homeView(id);
frame.setVisible(true);
}
public void detailView(String num, String pin) {
Commons commons = new Commons();
JFrame frame =(JFrame) commons.Frame();
//-----------------DETAILS------------------
JLabel sucss = new JLabel("REMEMBER THE DETAILS!!!");
sucss.setBounds(0, 200, 600, 50);
sucss.setHorizontalAlignment(JLabel.CENTER);
sucss.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(sucss);
JTextField number = new JTextField("CARD NUMBER : " + num);
number.setBounds(0, 300, 600, 50);
number.setEditable(false);
number.setHorizontalAlignment(JLabel.CENTER);
number.setFont(new Font("Rockwell", Font.BOLD, 20));
frame.add(number);
JTextField pinno = new JTextField("DEFAULT PIN : " + pin);
pinno.setBounds(0, 400, 600, 50);
pinno.setHorizontalAlignment(JLabel.CENTER);
pinno.setEditable(false);
pinno.setFont(new Font("Rockwell", Font.BOLD, 20));
frame.add(pinno);
//-----------------------------------------
frame.setVisible(true);
}
}
9. Failed Transaction Page
package atm;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Fail {
public void failView(String str) {
Commons commons = new Commons();
JFrame frame =(JFrame) commons.Frame();
//-----------------FAIL------------------
JLabel fail = new JLabel("YOUR TRANSACTIONS FAILED!!!");
fail.setBounds(0, 280, 600, 50);
fail.setHorizontalAlignment(JLabel.CENTER);
fail.setFont(new Font("Rockwell", Font.BOLD, 25));
JLabel st = new JLabel(str);
st.setBounds(0, 320, 600, 50);
st.setHorizontalAlignment(JLabel.CENTER);
st.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(st);
frame.add(fail);
//-----------------------------------------
frame.setVisible(true);
}
}
10. Home Page for Users
package atm;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Home {
public void homeView(int id) throws SQLException {
Operations operations = new Operations();
Font txt = new Font("", Font.BOLD, 25);
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
JLabel quick = new JLabel("< Quick Cash");
quick.setBounds(30, 250, 200, 30);
quick.setFont(txt);
JLabel withdraw = new JLabel("Withdraw >");
withdraw.setBounds(350, 250, 200, 30);
withdraw.setHorizontalAlignment(JLabel.RIGHT);
withdraw.setFont(txt);
JLabel deposit = new JLabel("< Deposit");
deposit.setBounds(30, 350, 200, 30);
deposit.setFont(txt);
JLabel sts = new JLabel("Mini Statement >");
sts.setBounds(350, 350, 200, 30);
sts.setHorizontalAlignment(JLabel.RIGHT);
sts.setFont(txt);
JLabel bal = new JLabel("< Balance Enquiry");
bal.setBounds(30, 450, 250, 30);
bal.setFont(txt);
JLabel pinchange = new JLabel("Change Pin >");
pinchange.setBounds(350, 450, 200, 30);
pinchange.setHorizontalAlignment(JLabel.RIGHT);
pinchange.setFont(txt);
frame.add(quick);
frame.add(withdraw);
frame.add(deposit);
frame.add(sts);
frame.add(bal);
frame.add(pinchange);
frame.setVisible(true);
quick.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
Quick qk = new Quick();
try {
qk.quickView(id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
withdraw.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("Withdraw Amount", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
deposit.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("Deposit Amount", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
sts.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
Statements state = new Statements();
try {
state.stateView(id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
bal.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("Balance", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
pinchange.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("New PIN", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
}
}
11. Quick Cash Window
package atm;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Quick {
public void quickView(int id) throws SQLException {
Operations oper = new Operations();
Font txt = new Font("", Font.BOLD, 25);
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
JLabel two = new JLabel("< 200");
two.setBounds(30, 250, 200, 30);
two.setFont(txt);
JLabel five = new JLabel("500 >");
five.setBounds(350, 250, 200, 30);
five.setHorizontalAlignment(JLabel.RIGHT);
five.setFont(txt);
JLabel ten = new JLabel("< 1000");
ten.setBounds(30, 350, 200, 30);
ten.setFont(txt);
JLabel twenty = new JLabel("2000 >");
twenty.setBounds(350, 350, 200, 30);
twenty.setHorizontalAlignment(JLabel.RIGHT);
twenty.setFont(txt);
JLabel fifty = new JLabel("< 5000");
fifty.setBounds(30, 450, 250, 30);
fifty.setFont(txt);
JLabel hundred = new JLabel("10000 >");
hundred.setBounds(350, 450, 200, 30);
hundred.setHorizontalAlignment(JLabel.RIGHT);
hundred.setFont(txt);
frame.add(two);
frame.add(five);
frame.add(ten);
frame.add(twenty);
frame.add(fifty);
frame.add(hundred);
frame.setVisible(true);
two.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(200, id);
frame.dispose();
}
});
five.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(500, id);
frame.dispose();
}
});
ten.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(1000, id);
frame.dispose();
}
});
twenty.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(2000, id);
frame.dispose();
}
});
fifty.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(5000, id);
frame.dispose();
}
});
hundred.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(10000, id);
frame.dispose();
}
});
}
}
12. Other Operations
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Operations {
SQLManage manage;
Fail fail;
Success success;
Operations() throws SQLException {
manage = new SQLManage();
fail = new Fail();
success = new Success();
}
public void opView(String str, int id) throws SQLException {
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
Font txt = new Font("", Font.BOLD, 15);
//-----------------AMOUNT/PIN------------------
JLabel label = new JLabel("Enter the " + str);
label.setBounds(50, 270, 250, 20);
label.setFont(txt);
JTextField amt = new JTextField();
amt.setBounds(50, 300, 500, 35);
amt.setFont(txt);
frame.add(label);
frame.add(amt);
//----------------------------------------------
//------------------SUBMIT------------------------
JButton sbt = new JButton("SUBMIT");
sbt.setBounds(200, 400, 200, 50);
sbt.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(sbt);
sbt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(str.equals("Withdraw Amount")) {
withdrawal(Integer.parseInt(amt.getText()), id);
frame.dispose();
}
else if(str.equals("Deposit Amount")) {
try {
manage.deposit(Integer.parseInt(amt.getText()), id);
success.successView(id);
frame.dispose();
}
catch (SQLException e1) {
e1.printStackTrace();
}
}
else if(str.equals("New PIN")){
try {
manage.pinchange(amt.getText(), id);
success.successView(id);
frame.dispose();
}
catch (SQLException e1) {
e1.printStackTrace();
}
}
}
});
//------------------------------------------------
if (str.equals("Balance")){
amt.setVisible(false);
sbt.setVisible(false);
label.setText("Your Balance is : ");
JLabel bal;
try {
bal = new JLabel(manage.balCheck(id)+"");
bal.setBounds(0, 325, 600, 20);
bal.setHorizontalAlignment(JLabel.CENTER);
bal.setFont(new Font("", Font.BOLD, 25));
frame.add(bal);
} catch (SQLException e1) {
e1.printStackTrace();
}
}
frame.setVisible(true);
}
public void withdrawal(int amount, int id) {
try {
int check = manage.withdraw(amount, id);
if(check==1) {
success.successView(id);
}
else {
fail.failView("INSUFFICIENT BALANCE!!!");
}
}
catch (SQLException e1) {
e1.printStackTrace();
}
}
}
13. Bank statements
package atm;
import java.awt.Font;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class Statements {
public void stateView(int id) throws SQLException {
DefaultTableModel model = new DefaultTableModel();
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
SQLManage manage = new SQLManage();
//----------------LABEL-----------------------
JLabel label = new JLabel("MINI STATEMENTS");
label.setBounds(0, 200, 575, 30);
label.setHorizontalAlignment(JLabel.CENTER);
label.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(label);
//--------------------------------------------
//---------------TABLE--------------------
JTable table=new JTable(){
public boolean isCellEditable(int row,int column){
return false;
}
};
model = (DefaultTableModel)table.getModel();
model.addColumn("ID");
model.addColumn("DEPOSIT");
model.addColumn("WITHDRAW");
model.addColumn("BALANCE");
table.getColumnModel().getColumn(0).setPreferredWidth(50);
table.getColumnModel().getColumn(1).setPreferredWidth(150);
table.getColumnModel().getColumn(2).setPreferredWidth(150);
table.getColumnModel().getColumn(2).setPreferredWidth(150);
JScrollPane sc = new JScrollPane(table);
sc.setBounds(50, 250, 500, 200);
frame.add(sc);
//-----------------------------------------------
//--------------------TABLEDATA------------------------
ResultSet rst = manage.stmt(id);
int i=0;
while(rst.next()) {
model.addRow(new Object[0]);
model.setValueAt(rst.getInt("transid"), i, 0);
if(rst.getString("stat").equals("dep")) {
model.setValueAt(rst.getString("amount"), i, 1);
model.setValueAt("-", i, 2);
}
else {
model.setValueAt("-", i, 1);
model.setValueAt(rst.getString("amount"), i, 2);
}
model.setValueAt(rst.getInt("bal"), i, 3);
i++;
}
//-----------------------------------------------------
frame.setVisible(true);
}
}
package atm;
import java.sql.SQLException;
public class Main {
public static void main(String[] args) throws InterruptedException, SQLException {
Login login = new Login();
login.loginView();
}
}
2. Login Module
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Login extends Commons{
public void loginView() {
Commons common = new Commons();
JFrame frame = (JFrame)common.Frame();
Font txt = new Font("", Font.BOLD, 15);
Pin pin = new Pin();
//---------------CARDNUMBER----------------
JLabel card = new JLabel("ENTER YOUR CARD NUMBER");
card.setBounds(50, 270, 250, 20);
card.setFont(txt);
JTextField cardNumber = new JTextField();
cardNumber.setBounds(50, 300, 500, 35);
cardNumber.setFont(txt);
frame.add(cardNumber);
frame.add(card);
//-----------------------------------------
//----------------ADMIN--------------------
JLabel admin = new JLabel("ADMIN LOGIN >");
admin.setBounds(0, 500, 570, 30);
admin.setHorizontalAlignment(JLabel.RIGHT);
admin.setFont(txt);
frame.add(admin);
admin.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
pin.pinView("admin");
frame.dispose();
}
});
//------------------------------------------
//-----------------BUTTON-----------------
JButton cont = new JButton("COUNTINUE");
cont.setBounds(200, 400, 200, 50);
cont.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(cont);
cont.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(cardNumber.getText().length() == 16) {
pin.pinView(cardNumber.getText());
frame.dispose();
}
else {
Fail fail = new Fail();
fail.failView("WRONG CARD NUMBER!!!");
frame.dispose();
}
}
});
//----------------------------------------
frame.setVisible(true);
}
}
3. Pin Checking Module
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
public class Pin {
public void pinView(String cardNum) {
Commons common = new Commons();
JFrame frame = (JFrame)common.Frame();
Font txt = new Font("", Font.BOLD, 15);
Home home = new Home();
Admin admin = new Admin();
//---------------PASSWORD----------------
JLabel pswd = new JLabel("ENTER YOUR PIN");
pswd.setBounds(50, 270, 250, 20);
pswd.setFont(txt);
JPasswordField pswdField = new JPasswordField();
pswdField.setBounds(50, 300, 500, 35);
pswdField.setFont(txt);
frame.add(pswdField);
frame.add(pswd);
//-----------------------------------------
//-----------------BUTTON-----------------
JButton cont = new JButton("COUNTINUE");
cont.setBounds(200, 400, 200, 50);
cont.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(cont);
cont.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
SQLManage man = new SQLManage();
ResultSet rst = man.check(cardNum, pswdField.getText());
if(rst.next()) {
if(rst.getString("card").equals("admin")) {
admin.adminView();
frame.dispose();
}
else {
home.homeView(rst.getInt("id"));
frame.dispose();
}
}
else {
Fail fail = new Fail();
fail.failView("WRONG PIN!!!");
frame.dispose();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
//----------------------------------------
frame.setVisible(true);
}
}
4. Admin home page
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Admin {
public void adminView() {
Commons commons = new Commons();
JFrame frame = (JFrame) commons.Frame();
//-------------ADDUSERS---------------------
JButton add = new JButton("ADD USERS");
add.setBounds(150, 250, 300, 100);
add.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(add);
add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
AddUser user = new AddUser();
try {
user.addView();
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
//------------------------------------------
//--------------EXIT---------------------------
JButton exit = new JButton("EXIT");
exit.setBounds(150, 400, 300, 100);
exit.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(exit);
exit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
//---------------------------------------------
frame.setVisible(true);
}
}
5. Module to add users
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.util.Random;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class AddUser {
JTextField pinField, atmField;
Random random = new Random();
public void addView() throws SQLException {
Commons commons = new Commons();
JFrame frame = (JFrame) commons.Frame();
Font txt = new Font("", Font.BOLD, 20);
SQLManage manage = new SQLManage();
Success success = new Success();
//--------------NAME--------------------
JLabel name = new JLabel("Name : ");
name.setBounds(50, 200, 100, 25);
name.setFont(txt);
JTextField nmField = new JTextField();
nmField.setBounds(50, 230, 500, 30);
frame.add(nmField);
frame.add(name);
//--------------------------------------
//-------------ATMNUMBER------------------
JLabel atmno = new JLabel("ATM Card Number : ");
atmno.setBounds(50, 300, 500, 25);
atmno.setFont(txt);
atmField = new JTextField();
atmField.setBounds(50, 330, 500, 30);
atmField.setEditable(false);
frame.add(atmField);
frame.add(atmno);
//----------------------------------------
//-------------ATMPIN------------------
JLabel atmpin = new JLabel("ATM Card PIN : ");
atmpin.setBounds(50, 400, 500, 25);
atmpin.setFont(txt);
pinField = new JTextField();
pinField.setBounds(50, 430, 200, 30);
pinField.setEditable(false);
frame.add(pinField);
frame.add(atmpin);
//----------------------------------------
//-------------BALANCE------------------
JLabel bal = new JLabel("BALANCE : ");
bal.setBounds(350, 400, 500, 25);
bal.setFont(txt);
JTextField balField = new JTextField();
balField.setBounds(350, 430, 200, 30);
frame.add(balField);
frame.add(bal);
//----------------------------------------
//--------------AUTOGENERATION----------------
auto();
//---------------------------------------------
//---------------SUBMIT-------------------
JButton sbmt = new JButton("SUBMIT");
sbmt.setBounds(200, 500, 200, 50);
frame.add(sbmt);
sbmt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(!nmField.getText().equals("")) {
if(balField.getText().equals(""))
balField.setText("0");
try {
manage.adding(atmField.getText(), pinField.getText(), nmField.getText(), balField.getText());
} catch (SQLException e1) {
e1.printStackTrace();
}
success.detailView(atmField.getText(), pinField.getText());
balField.setText("");
nmField.setText("");
auto();
}
}
});
//------------------------------------------
frame.setVisible(true);
}
public void auto() {
String str = "";
for(int i=0; i<16; i++) {
str += random.nextInt(9 - 0 + 1) + 0;
}
atmField.setText(str);
str = "";
for(int i=0; i<4; i++) {
str += random.nextInt(9 - 0 + 1) + 0;
}
pinField.setText(str);
}
}
6. Database Management Module
package atm;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class SQLManage {
Connection con;
SQLManage() throws SQLException {
String usr = "root";
String pass = "password";
String url = "jdbc:mysql://localhost:3306/atm";
con = DriverManager.getConnection(url, usr, pass);
}
public ResultSet check(String usr, String pass) throws SQLException {
String str = "SELECT * FROM users WHERE card = '"+ usr +"' AND pin = '"+ pass+ "'";
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery(str);
return rst;
}
public void deposit(int amt, int id) throws SQLException {
String str = "UPDATE users SET bal = bal + "+amt+" WHERE id = "+id;
Statement stm = con.createStatement();
stm.executeUpdate(str);
int bal = balCheck(id);
str = "INSERT INTO transactions (id, amount, stat, bal) VALUES("+id+", "+amt+", 'dep', "+bal+")";
Statement stm2 = con.createStatement();
stm2.executeUpdate(str);
}
public int withdraw(int amt, int id) throws SQLException {
int bal = balCheck(id);
if(bal >= amt) {
String str = "UPDATE users SET bal = bal - "+amt+" WHERE id = "+id;
Statement stm = con.createStatement();
stm.executeUpdate(str);
bal -= amt;
str = "INSERT INTO transactions (id, amount, stat, bal) VALUES("+id+", "+amt+", 'wit', "+bal+")";
Statement stm2 = con.createStatement();
stm2.executeUpdate(str);
return 1;
}
return 0;
}
public void pinchange(String pin, int id) throws SQLException {
String str = "UPDATE users SET pin = '"+pin+"' WHERE id = " + id;
Statement stm = con.createStatement();
stm.executeUpdate(str);
}
public int balCheck(int id) throws SQLException {
String str = "SELECT bal FROM users WHERE id = " + id;
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery(str);
rst.next();
return rst.getInt("bal");
}
public ResultSet stmt(int id) throws SQLException {
String str = "SELECT * FROM transactions WHERE id = " + id + " order by transid desc";
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery(str);
return rst;
}
public void adding(String card, String pin, String name, String bal) throws SQLException {
String str = "INSERT INTO users (card, pin, uname, bal) values ('" +card+ "', '"+pin+"', '"+name+"', "+bal+")";
Statement stm = con.createStatement();
stm.executeUpdate(str);
}
}
7. Common Frame and Logo
package atm;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Commons {
public Component Frame() {
JFrame frame = new JFrame();
frame.setSize(600, 600);
frame.setLocationRelativeTo(null);
frame.setLayout(null);
frame.setResizable(false);
frame.getContentPane().setBackground(Color.decode("#ADD8E6"));
//------------------LOGO----------------------------------
JLabel atm = new JLabel("ATM");
atm.setBounds(0, 30, 600, 120);
atm.setHorizontalAlignment(JLabel.CENTER);
atm.setFont(new Font("Monospaced", Font.BOLD, 120));
JLabel man = new JLabel("MANAGEMENT SYSTEM");
man.setBounds(0, 140, 600, 20);
man.setHorizontalAlignment(JLabel.CENTER);
man.setFont(new Font("Monospaced", Font.BOLD, 20));
frame.add(man);
frame.add(atm);
//-----------------------------------------------
return frame;
}
}
8. Success Page
package atm;
import java.awt.Font;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Success {
public void successView(int id) throws SQLException {
Home home = new Home();
Commons commons = new Commons();
JFrame frame =(JFrame) commons.Frame();
//-----------------SUCCESS------------------
JLabel sucss = new JLabel("TRANSACTION SUCCESS.");
sucss.setBounds(0, 280, 600, 50);
sucss.setHorizontalAlignment(JLabel.CENTER);
sucss.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(sucss);
//-----------------------------------------
home.homeView(id);
frame.setVisible(true);
}
public void detailView(String num, String pin) {
Commons commons = new Commons();
JFrame frame =(JFrame) commons.Frame();
//-----------------DETAILS------------------
JLabel sucss = new JLabel("REMEMBER THE DETAILS!!!");
sucss.setBounds(0, 200, 600, 50);
sucss.setHorizontalAlignment(JLabel.CENTER);
sucss.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(sucss);
JTextField number = new JTextField("CARD NUMBER : " + num);
number.setBounds(0, 300, 600, 50);
number.setEditable(false);
number.setHorizontalAlignment(JLabel.CENTER);
number.setFont(new Font("Rockwell", Font.BOLD, 20));
frame.add(number);
JTextField pinno = new JTextField("DEFAULT PIN : " + pin);
pinno.setBounds(0, 400, 600, 50);
pinno.setHorizontalAlignment(JLabel.CENTER);
pinno.setEditable(false);
pinno.setFont(new Font("Rockwell", Font.BOLD, 20));
frame.add(pinno);
//-----------------------------------------
frame.setVisible(true);
}
}
9. Failed Transaction Page
package atm;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Fail {
public void failView(String str) {
Commons commons = new Commons();
JFrame frame =(JFrame) commons.Frame();
//-----------------FAIL------------------
JLabel fail = new JLabel("YOUR TRANSACTIONS FAILED!!!");
fail.setBounds(0, 280, 600, 50);
fail.setHorizontalAlignment(JLabel.CENTER);
fail.setFont(new Font("Rockwell", Font.BOLD, 25));
JLabel st = new JLabel(str);
st.setBounds(0, 320, 600, 50);
st.setHorizontalAlignment(JLabel.CENTER);
st.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(st);
frame.add(fail);
//-----------------------------------------
frame.setVisible(true);
}
}
10. Home Page for Users
package atm;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Home {
public void homeView(int id) throws SQLException {
Operations operations = new Operations();
Font txt = new Font("", Font.BOLD, 25);
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
JLabel quick = new JLabel("< Quick Cash");
quick.setBounds(30, 250, 200, 30);
quick.setFont(txt);
JLabel withdraw = new JLabel("Withdraw >");
withdraw.setBounds(350, 250, 200, 30);
withdraw.setHorizontalAlignment(JLabel.RIGHT);
withdraw.setFont(txt);
JLabel deposit = new JLabel("< Deposit");
deposit.setBounds(30, 350, 200, 30);
deposit.setFont(txt);
JLabel sts = new JLabel("Mini Statement >");
sts.setBounds(350, 350, 200, 30);
sts.setHorizontalAlignment(JLabel.RIGHT);
sts.setFont(txt);
JLabel bal = new JLabel("< Balance Enquiry");
bal.setBounds(30, 450, 250, 30);
bal.setFont(txt);
JLabel pinchange = new JLabel("Change Pin >");
pinchange.setBounds(350, 450, 200, 30);
pinchange.setHorizontalAlignment(JLabel.RIGHT);
pinchange.setFont(txt);
frame.add(quick);
frame.add(withdraw);
frame.add(deposit);
frame.add(sts);
frame.add(bal);
frame.add(pinchange);
frame.setVisible(true);
quick.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
Quick qk = new Quick();
try {
qk.quickView(id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
withdraw.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("Withdraw Amount", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
deposit.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("Deposit Amount", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
sts.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
Statements state = new Statements();
try {
state.stateView(id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
bal.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("Balance", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
pinchange.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
try {
operations.opView("New PIN", id);
} catch (SQLException e1) {
e1.printStackTrace();
}
frame.dispose();
}
});
}
}
11. Quick Cash Window
package atm;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Quick {
public void quickView(int id) throws SQLException {
Operations oper = new Operations();
Font txt = new Font("", Font.BOLD, 25);
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
JLabel two = new JLabel("< 200");
two.setBounds(30, 250, 200, 30);
two.setFont(txt);
JLabel five = new JLabel("500 >");
five.setBounds(350, 250, 200, 30);
five.setHorizontalAlignment(JLabel.RIGHT);
five.setFont(txt);
JLabel ten = new JLabel("< 1000");
ten.setBounds(30, 350, 200, 30);
ten.setFont(txt);
JLabel twenty = new JLabel("2000 >");
twenty.setBounds(350, 350, 200, 30);
twenty.setHorizontalAlignment(JLabel.RIGHT);
twenty.setFont(txt);
JLabel fifty = new JLabel("< 5000");
fifty.setBounds(30, 450, 250, 30);
fifty.setFont(txt);
JLabel hundred = new JLabel("10000 >");
hundred.setBounds(350, 450, 200, 30);
hundred.setHorizontalAlignment(JLabel.RIGHT);
hundred.setFont(txt);
frame.add(two);
frame.add(five);
frame.add(ten);
frame.add(twenty);
frame.add(fifty);
frame.add(hundred);
frame.setVisible(true);
two.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(200, id);
frame.dispose();
}
});
five.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(500, id);
frame.dispose();
}
});
ten.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(1000, id);
frame.dispose();
}
});
twenty.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(2000, id);
frame.dispose();
}
});
fifty.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(5000, id);
frame.dispose();
}
});
hundred.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
oper.withdrawal(10000, id);
frame.dispose();
}
});
}
}
12. Other Operations
package atm;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Operations {
SQLManage manage;
Fail fail;
Success success;
Operations() throws SQLException {
manage = new SQLManage();
fail = new Fail();
success = new Success();
}
public void opView(String str, int id) throws SQLException {
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
Font txt = new Font("", Font.BOLD, 15);
//-----------------AMOUNT/PIN------------------
JLabel label = new JLabel("Enter the " + str);
label.setBounds(50, 270, 250, 20);
label.setFont(txt);
JTextField amt = new JTextField();
amt.setBounds(50, 300, 500, 35);
amt.setFont(txt);
frame.add(label);
frame.add(amt);
//----------------------------------------------
//------------------SUBMIT------------------------
JButton sbt = new JButton("SUBMIT");
sbt.setBounds(200, 400, 200, 50);
sbt.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(sbt);
sbt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(str.equals("Withdraw Amount")) {
withdrawal(Integer.parseInt(amt.getText()), id);
frame.dispose();
}
else if(str.equals("Deposit Amount")) {
try {
manage.deposit(Integer.parseInt(amt.getText()), id);
success.successView(id);
frame.dispose();
}
catch (SQLException e1) {
e1.printStackTrace();
}
}
else if(str.equals("New PIN")){
try {
manage.pinchange(amt.getText(), id);
success.successView(id);
frame.dispose();
}
catch (SQLException e1) {
e1.printStackTrace();
}
}
}
});
//------------------------------------------------
if (str.equals("Balance")){
amt.setVisible(false);
sbt.setVisible(false);
label.setText("Your Balance is : ");
JLabel bal;
try {
bal = new JLabel(manage.balCheck(id)+"");
bal.setBounds(0, 325, 600, 20);
bal.setHorizontalAlignment(JLabel.CENTER);
bal.setFont(new Font("", Font.BOLD, 25));
frame.add(bal);
} catch (SQLException e1) {
e1.printStackTrace();
}
}
frame.setVisible(true);
}
public void withdrawal(int amount, int id) {
try {
int check = manage.withdraw(amount, id);
if(check==1) {
success.successView(id);
}
else {
fail.failView("INSUFFICIENT BALANCE!!!");
}
}
catch (SQLException e1) {
e1.printStackTrace();
}
}
}
13. Bank statements
package atm;
import java.awt.Font;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class Statements {
public void stateView(int id) throws SQLException {
DefaultTableModel model = new DefaultTableModel();
Commons commons = new Commons();
JFrame frame = (JFrame)commons.Frame();
SQLManage manage = new SQLManage();
//----------------LABEL-----------------------
JLabel label = new JLabel("MINI STATEMENTS");
label.setBounds(0, 200, 575, 30);
label.setHorizontalAlignment(JLabel.CENTER);
label.setFont(new Font("Rockwell", Font.BOLD, 25));
frame.add(label);
//--------------------------------------------
//---------------TABLE--------------------
JTable table=new JTable(){
public boolean isCellEditable(int row,int column){
return false;
}
};
model = (DefaultTableModel)table.getModel();
model.addColumn("ID");
model.addColumn("DEPOSIT");
model.addColumn("WITHDRAW");
model.addColumn("BALANCE");
table.getColumnModel().getColumn(0).setPreferredWidth(50);
table.getColumnModel().getColumn(1).setPreferredWidth(150);
table.getColumnModel().getColumn(2).setPreferredWidth(150);
table.getColumnModel().getColumn(2).setPreferredWidth(150);
JScrollPane sc = new JScrollPane(table);
sc.setBounds(50, 250, 500, 200);
frame.add(sc);
//-----------------------------------------------
//--------------------TABLEDATA------------------------
ResultSet rst = manage.stmt(id);
int i=0;
while(rst.next()) {
model.addRow(new Object[0]);
model.setValueAt(rst.getInt("transid"), i, 0);
if(rst.getString("stat").equals("dep")) {
model.setValueAt(rst.getString("amount"), i, 1);
model.setValueAt("-", i, 2);
}
else {
model.setValueAt("-", i, 1);
model.setValueAt(rst.getString("amount"), i, 2);
}
model.setValueAt(rst.getInt("bal"), i, 3);
i++;
}
//-----------------------------------------------------
frame.setVisible(true);
}
}
Rahaf Qa- ..
- تاريخ التسجيل : 08/09/2023
المساهمات : 17
النقاط : 51
التقيم : 0
الدولة :
الجنس :
| |
منتدى مصر التقني :: قسم لغات البرمجة Programming languages :: لغة الجافا Java :: مشاريع مفتوحة المصدر Java App
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى
الخميس سبتمبر 19, 2024 7:49 am من طرف mona mohamed
» شركة مكافحة بق الفراش بالرياض
الثلاثاء سبتمبر 17, 2024 6:16 pm من طرف moslema_r
» حجر هاشمى سانت كاترين بافضل الاسعار والخصومات
الثلاثاء سبتمبر 17, 2024 2:16 pm من طرف nadya
» افضل موقع شراء اثاث مستعمل بالكويت بخصم 15% | دليل الخدمات المنزلية
الثلاثاء سبتمبر 17, 2024 1:55 pm من طرف nadya
» كراتين نقل عفش الكويت للبيع بخصم 20% | دليل الخدمات المنزلية
الثلاثاء سبتمبر 17, 2024 1:38 pm من طرف nadya
» شركات عمل تطبيقات – تك سوفت للحلول الذكية – Tec Soft for SMART solutions
الثلاثاء سبتمبر 17, 2024 1:23 pm من طرف سها ياسر
» تركيب الحجر الفرعوني بخصم 50% - الحمد للرخام والجرانيت
الثلاثاء سبتمبر 17, 2024 9:04 am من طرف nadya
» تصميم تطبيق جوال لمركز طبي
الثلاثاء سبتمبر 17, 2024 7:57 am من طرف mona mohamed
» تصميم تطبيق جوال للأسر المنتجة
الإثنين سبتمبر 16, 2024 10:02 am من طرف mona mohamed
» شركة مكافحة حشرات بالرياض
السبت سبتمبر 14, 2024 6:21 pm من طرف moslema_r