Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   need help !!! urgent (http://www.go4expert.com/forums/need-help-urgent-t1708/)

hing 23Oct2006 14:18

need help !!! urgent
hey there guys... am trying to complete my project which is to create a Library System. Was able to create a list to show the books available when they select the book and click a borrow button it can print out the book.

what problem i have now is that when a student click borrow... the value how can i transfer to an array inside the object student.

i am usin a main screen (ms) who is controlling all the functions. been trying and trying on this for very long hopefully there will be those who are able to help me out.

my customer screen would be like this... but how can i add in the array for books borrowed


import javax.swing.*;
class Customer
        private String name;
        private int accNo;
        private String password;
        private double balance;
        private String borrow;
        static int borrowCount=0;
        static int customerCount=0;
        private MainScreen ms;
        Customer(String n, int no, String p, double b)
                JOptionPane.showMessageDialog(null,name +" record created");
        public String setStudentBorrow(String a)
                JOptionPane.showMessageDialog(null,"Book Borrowed");
        public String getStudentBorrow()
        {        return borrow;        }
        /*public String setBorrow(String a)
        public String getBorrow()
        {        for (int i=0;i<5;i++)
                        return borrow[i];
        public String getPassword()
        {        return password;        }
        public String getName()
        {        return name;                }
        public int getAccNo()
        {        return accNo;        }
        public double getBalance()
        {        return balance;        }
        public void setName(String n)
        {        name=n;        }
        public void setPassword(String p)
        {        password=p;        }
        public void setBalance(double b)
        {        balance=b;        }
        public void setAccNo(int no)
        {        accNo=no;        }
        public void display()
                //"\nCutomer Number : "+ customerCount+
                "\nName :"+name+
                "\nAccount Number: "+accNo+
                "\nBalance (RM): "+balance,"Customer record",
                JOptionPane.INFORMATION_MESSAGE        );

All times are GMT +5.5. The time now is 00:22.