简体   繁体   中英

Eclipse Source not found

i have the following code

                    cmd.printSuccess("Login Success !", form_name); 
                Cl_Main mainform = new Cl_Main(); //at this line, program stop, show Source Not Found
                mainform.showFormAdmin(true);
                cmd.printSuccess("Login Success 2!", form_name); // never made to this point

and then, program show 在此处输入图片说明 and when i click edit source lookup path 在此处输入图片说明

perhaps is there something missing in my code

public void showFormAdmin(boolean statusnya)
    {       
        JMenuBar Menubar;       
        JMenu Filemenu, Mastermenu, Transactionmenu;
        JMenuItem Logoutfilemenu,Exitfilemenu, Consolemastermenu, Usermastermenu, Dotransactionmenu, Viewtransactionmenu;

        Menubar = new JMenuBar();
        Filemenu = new JMenu(menu_filemenu);
        Mastermenu = new JMenu(menu_mastermenu);
        Transactionmenu = new JMenu(menu_transactionmenu);
        Logoutfilemenu = new JMenuItem(new AbstractAction(menuitem_logoutfilemenu) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                setVisible(false);              
                loginform.setVisible(true);
                cmd.printSuccess("Logout Successfully !", form_name);

            }
        });
        Exitfilemenu = new JMenuItem(new AbstractAction(menuitem_exitfilemenu) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                System.exit(0);
            }
        });
        Consolemastermenu = new JMenuItem(new AbstractAction(menuitem_consolemastermenu) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                cmd.printSuccess("Show Menu Console", form_name);
//              masterconsoleform.showMasterConsole();              
            }
        });
        Usermastermenu = new JMenuItem(new AbstractAction(menuitem_usermastermenu) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                cmd.printSuccess("Show Menu User", form_name);

            }
        });
        Dotransactionmenu = new JMenuItem(new AbstractAction(menuitem_dotransactionmenu) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                cmd.printSuccess("Show Do Transaction", form_name);
            }
        });     
        Viewtransactionmenu = new JMenuItem(new AbstractAction(menuitem_viewtransactionmenu) {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                cmd.printSuccess("Show view trans", form_name);
            }
        });

        Menubar.add(Filemenu);
        Menubar.add(Mastermenu);
        Menubar.add(Transactionmenu);       

        Filemenu.add(Logoutfilemenu);
        Filemenu.add(Exitfilemenu);
        Mastermenu.add(Consolemastermenu);
        Mastermenu.add(Usermastermenu);
        Transactionmenu.add(Dotransactionmenu);
        Transactionmenu.add(Viewtransactionmenu);               

        if(statusnya)
        {
            Transactionmenu.setEnabled(statusnya);
            Mastermenu.setEnabled(statusnya);
        }
        else
        {
            Transactionmenu.setEnabled(statusnya);
            Mastermenu.setEnabled(!statusnya);
        }

        desktopnya = new JDesktopPane();
        desktopnya.add(Menubar);
        getContentPane().add(desktopnya,BorderLayout.CENTER);
        setVisible(true);
        setResizable(false);
        setExtendedState(getExtendedState()|MAXIMIZED_BOTH);
        setJMenuBar(Menubar);
        setTitle(form_name);

    }

to be honest, i dont understand what causing my problem stopped and do not continue to show Main Form.

why does eclipse warn with Source not Found Message ? how to resolve this problem ?

You're trying to read the Source of the EventDispatchThread, but you Eclipse cant find it, since you're using a JRE.

Download a JDK (Java Development Kit) and add it to Eclipse (Window => Preferences => Java => Installed JREs => Add...). Use the installation dir (eg C:\\Program Files\\Java\\jdk1.8.0_45 )

The Source should be automatically added, if not, add it via the second Dialog you got, the source is in your installation directory of the jdk, eg C:\\Program Files\\Java\\jdk1.8.0_45\\src.zip .

The Problem why your Main Form isn't displayed is that your are getting a StackOverFlowError, that means you have a Method which called itself over and over again. Must be somewhere in the Constructor of Cl_Main, but you didn't provide the code for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM