简体   繁体   English

找不到Eclipse Source

[英]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 当我单击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. 老实说,我不明白是什么原因导致我的问题停止了,并且不再继续显示Main表格。

why does eclipse warn with Source not Found Message ? 为什么eclipse用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. 您正在尝试阅读EventDispatchThread的源代码,但是由于使用的是JRE,因此Eclipse无法找到它。

Download a JDK (Java Development Kit) and add it to Eclipse (Window => Preferences => Java => Installed JREs => Add...). 下载一个JDK(Java开发工具包)并将其添加到Eclipse(Window => Preferences => Java => Installed JREs => Add ...)。 Use the installation dir (eg C:\\Program Files\\Java\\jdk1.8.0_45 ) 使用安装目录(例如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 . 应该自动添加Source,如果没有,则通过第二个对话框将其添加,该源位于jdk的安装目录中,例如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. 为什么不显示您的主窗体的问题是您遇到了StackOverFlowError,这意味着您有一个反复调用自身的Method。 Must be somewhere in the Constructor of Cl_Main, but you didn't provide the code for that. 必须在Cl_Main的构造函数中的某个位置,但是您没有提供代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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