Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Pls Help me run bank java application

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pls Help me run bank java application

    hi i am having a error running this banking application "Bank_Application_System"

    the application is a banking system where customers can withdraw and deposit money and other functions. I downloaded it from Bank_Application_System - Java Engineering Project Download But when i run it in netbeans it comes up with a error in the class Display2 saying there is a problem with "ResultsModel model;" saying it cannot find symbol also "import java.io.*;" says it is a unused import. Can somone help me pls

    This is the code for the Display2Class there the error is
    package bankapplication2;
     
     
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.io.*;
     
    public class Display2 extends JFrame //implements ActionListener
    {
        private JLabel jlabel1;
        private JLabel jlabel2;
        private JLabel jlabel3;
        private JLabel jlabel4;
        private JLabel jlabel5;
     
        private JTextField NAME;
        private JTextField ACC;
        private JTextField DATE;
        private JTextField ADD;
        private JTextField AGE;
        private JTextField BALANCE;
     
        private JButton jbutton;
     
        private JPanel jpanel1;
        private JPanel jpanel2;
        private JPanel jpanel3;
     
        JLabel command=new JLabel();
        JScrollPane resultsPane;
        Connection connection;
        Statement statement;
        ResultsModel model;
     
        void displayaccount(String s1,String s2,String s3,String s4,String s5)
        {
            System.out.println("HHH"+s1+" "+s2+" "+s3+" "+s4+" "+s5);
            jlabel1 = new JLabel("NAME");
            jlabel2 = new JLabel("ACC_NUM");
            jlabel3 = new JLabel("DATE");
            jlabel4 = new JLabel("ADDRESS");
            jlabel5 = new JLabel("AGE");
     
            jpanel1 = new JPanel();
            jpanel1.setLayout(new GridLayout(1,1,40,40));
            jpanel1.add(jlabel1);
            jpanel1.add(jlabel2);
            jpanel1.add(jlabel3);
            jpanel1.add(jlabel4);
            jpanel1.add(jlabel5);
     
            jbutton = new JButton("OK");
     
            NAME = new JTextField(8);
            ACC = new JTextField(8);
            DATE = new JTextField(8);
            ADD = new JTextField(8);
            AGE = new JTextField(8);
     
            jpanel2 = new JPanel();
            jpanel2.setLayout(new GridLayout(1,1,1,1));
            jpanel2.add(NAME);
            jpanel2.add(ACC);
            jpanel2.add(DATE);
            jpanel2.add(ADD);
            jpanel2.add(AGE);
     
            jpanel3 = new JPanel();
            jpanel3.setLayout(new GridLayout(1,1,1,1));
            jpanel3.add(jbutton);
     
            Container conntainer = getContentPane();
            conntainer.setLayout(new FlowLayout());
            conntainer.add(jpanel1);
     
            Container conntainer1 = getContentPane();
            conntainer1.setLayout(new FlowLayout());
            conntainer1.add(jpanel2);
     
            Container conntainer2 = getContentPane();
            conntainer2.setLayout(new FlowLayout());
            conntainer2.add(jpanel3);
     
            NAME.setText(s1);
            ACC.setText(s2);
            DATE.setText(s3);
            ADD.setText(s4);
            AGE.setText(s5);
     
            setVisible(true);
            setTitle("Account Information");
            setBounds(100,100,480,120);
            setResizable(false);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            jbutton.addActionListener(new ActionListener()
            {
                public void actionPerformed(ActionEvent e)
                {
                    setVisible(false);
                    MainMenu mm=new MainMenu();
                    mm.menu();
                }
            });
        }
     
        void displaybalance(String s1,String s2,String s3)
        {
            System.out.println("HHH"+s1+" "+s2+" "+s3);
            jlabel1 = new JLabel("NAME");
            jlabel2 = new JLabel("ACC_NUM");
            jlabel3 = new JLabel("BALANCE");
     
            jpanel1 = new JPanel();
            jpanel1.setLayout(new GridLayout(1,1,40,40));
            jpanel1.add(jlabel1);
            jpanel1.add(jlabel2);
            jpanel1.add(jlabel3);
     
            jbutton = new JButton("OK");
     
            NAME = new JTextField(8);
            ACC = new JTextField(8);
            BALANCE = new JTextField(8);
     
            jpanel2 = new JPanel();
            jpanel2.setLayout(new GridLayout(1,1,1,1));
            jpanel2.add(NAME);
            jpanel2.add(ACC);
            jpanel2.add(BALANCE);
     
            jpanel3 = new JPanel();
            jpanel3.setLayout(new GridLayout(1,1,1,1));
            jpanel3.add(jbutton);
     
            Container conntainer = getContentPane();
            conntainer.setLayout(new FlowLayout());
            conntainer.add(jpanel1);
     
            Container conntainer1 = getContentPane();
            conntainer1.setLayout(new FlowLayout());
            conntainer1.add(jpanel2);
     
            Container conntainer2 = getContentPane();
            conntainer2.setLayout(new FlowLayout());
            conntainer2.add(jpanel3);
     
            NAME.setText(s1);
            ACC.setText(s2);
            BALANCE.setText(s3);
     
            setVisible(true);
            setTitle("Account Information");
            setBounds(100,100,330,120);
            setResizable(false);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            jbutton.addActionListener(new ActionListener()
            {
                public void actionPerformed(ActionEvent e)
                {
                    setVisible(false);
                    MainMenu mm=new MainMenu();
                    mm.menu();
                }
            });
        }
     
        void displaydeposit(String s,int i)
        {
            String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
            String url = "jdbc:odbc:BankDatabase";
            setBounds(100,100,480,120);
            setResizable(false);
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            JButton OK = new JButton("OK");
     
            JLabel lable=new JLabel("Customer Database");
            lable.setToolTipText("Customer Database");
            lable.setFont(new Font("SansSerif",Font.BOLD,18));
            JPanel lpanel=new JPanel();
            lable.setForeground(Color.red);
            lpanel.setBackground(Color.orange);
            lpanel.add(lable,"Center");
            lpanel.setToolTipText("Customer Database");
     
     
           Container contentPane=getContentPane();
           contentPane.add(lpanel,"North");
     
           getContentPane().add(OK,BorderLayout.SOUTH);
     
           try
            {
                Class.forName(driver);
                connection=DriverManager.getConnection(url);
                statement=connection.createStatement();
     
                model=new ResultsModel();
                JTable table=new JTable(model);
                //table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                resultsPane=new JScrollPane(table);
                getContentPane().add(resultsPane,BorderLayout.CENTER);
                if(i==1)    
                model.setResultSet(statement.executeQuery("SELECT * from DepositInfo WHERE Account_Num = '"+s+"'"));
                else if(i==2)
                model.setResultSet(statement.executeQuery("SELECT * from WithdrawInfo WHERE Account_Num = '"+s+"'"));    
     
                OK.addActionListener(new ActionListener()
                {
                    public void actionPerformed(ActionEvent e)
                    {
                        MainMenu mm = new MainMenu();
                        mm.menu();
                        setVisible(false);
                    }
                });
            }
            catch(ClassNotFoundException cnf)
            {
                System.out.println(cnf);
            }
     
            catch(SQLException sql)
            {
                System.out.println(sql);
            }
     
            pack();
            setVisible(true);
        }
     
        /*private JMenuItem makeMenuItem(String name)
        {
            JMenuItem m=new JMenuItem(name);
            m.addActionListener(this);
            return m;
        }
        public void actionPerformed(ActionEvent evt)
        {
              String command=evt.getActionCommand();
              if(command.equals("OK"))
              {
                  setVisible(false);
                    MainMenu mm=new MainMenu();
                    mm.menu();
              }
        }*/
     
    }

    This is the error message when i run it

    init:
    deps-clean:
    Created dir: C:\Users\Documents\NetBeansProjects\BankApplication2\build
    Updating property file: C:\Users\Documents\NetBeansProjects\BankApplication2\build\built-clean.properties
    Deleting directory C:\Users\Documents\NetBeansProjects\BankApplication2\build
    clean:
    init:
    deps-jar:
    Created dir: C:\Users\\Documents\NetBeansProjects\BankApplication2\build
    Updating property file: C:\Users\Documents\NetBeansProjects\BankApplication2\build\built-jar.properties
    Created dir: C:\Users\Documents\NetBeansProjects\BankApplication2\build\classes
    Created dir: C:\Users\Documents\NetBeansProjects\BankApplication2\build\empty
    Compiling 8 source files to C:\Users\Documents\NetBeansProjects\BankApplication2\build\classes
    C:\Users\arinze\Documents\NetBeansProjects\BankApplication2\src\bankapplication2\Display2.java:35: cannot find symbol
    symbol  : class ResultsModel
    location: class bankapplication2.Display2
        ResultsModel model;
    C:\Users\arinze\Documents\NetBeansProjects\BankApplication2\src\bankapplication2\Display2.java:201: cannot find symbol
    symbol  : class ResultsModel
    location: class bankapplication2.Display2
                model=new ResultsModel();
    2 errors
    C:\Users\Documents\NetBeansProjects\BankApplication2\nbproject\build-impl.xml:413: The following error occurred while executing this line:
    C:\Users\Documents\NetBeansProjects\BankApplication2\nbproject\build-impl.xml:199: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)

    This is the link for java api for resultModel: ResultsModel but i am not sure how to configure the class Display2 to get it working.
    Last edited by chukster; September 20th, 2010 at 03:40 PM. Reason: add helpfull info


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,661
    Thanks
    45
    Thanked 1,960 Times in 1,934 Posts

    Default Re: Pls Help me run bank java application

    Where is the definition for the ResultsModel class? Is there a missing library or source file?

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Pls Help me run bank java application

    here it is just click on the next word: ResultsModel

  4. #4
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    489
    Thanks
    8
    Thanked 45 Times in 43 Posts

    Default Re: Pls Help me run bank java application


  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,661
    Thanks
    45
    Thanked 1,960 Times in 1,934 Posts

    Default Re: Pls Help me run bank java application

    Where is the library with the org.eclipse.tptp.platform.analysis.core.ui.interna l.model package in it?
    You need that to compile your program.

Similar Threads

  1. Please help - Bank account application
    By brandonssss in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 2nd, 2010, 03:10 PM
  2. Create a java small class for a bank account!!?
    By jon123 in forum Object Oriented Programming
    Replies: 2
    Last Post: March 24th, 2010, 11:00 AM
  3. Replies: 0
    Last Post: December 3rd, 2009, 03:43 PM
  4. Bank account GUI using swing
    By AlanM595 in forum AWT / Java Swing
    Replies: 5
    Last Post: April 2nd, 2009, 04:39 AM
  5. How to delete records from a Random-Access File?
    By keith in forum File I/O & Other I/O Streams
    Replies: 10
    Last Post: March 31st, 2009, 11:40 AM

Tags for this Thread