JB的Debug大概是我见过Bug最多的Debug了……我早就仍了JB这个垃圾了(就是因为Debug把我烦死了)

解决方案 »

  1.   

    从来没有用过Debug,所以不知道。也不知道他的Debug比我自己Debug先进在那里。不过楼上的扔掉了这个垃圾,不知道现在在用哪个宝贝啊?推荐出来大家共享嘛。
      

  2.   

    to by92419,
    你是否配置了项目的默认运行程序?
      

  3.   

    不要使用debug jb的debug就是变态
      

  4.   

    to li_haizhou:
    我是新学的,安装完后就新建了一个工程,再向增加一个Application后,米没有任何改动,不知如何配置项目的默认运行程序?
      

  5.   

    Project => Project properties选择Run页,再选择Application页,点击Main class后面的按钮,指定你自己的class名称。
      

  6.   

    能不能详细说明下Project properties和Default Project properties的区别,以及RunTime Configurations的含义,配置和不配置对应用程序有很大的影响吗?我的程序的代码如下,请问如何配置,谢谢!分不够可以再加。package MyTest;import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;/**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2003</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class MyFram extends JFrame {
      JPanel contentPane;
      JMenuBar jMenuBar1 = new JMenuBar();
      JMenu jMenuFile = new JMenu();
      JMenuItem jMenuFileExit = new JMenuItem();
      JMenu jMenuHelp = new JMenu();
      JMenuItem jMenuHelpAbout = new JMenuItem();
      JToolBar jToolBar = new JToolBar();
      JButton jButton1 = new JButton();
      JButton jButton2 = new JButton();
      JButton jButton3 = new JButton();
      ImageIcon image1;
      ImageIcon image2;
      ImageIcon image3;
      JLabel statusBar = new JLabel();
      BorderLayout borderLayout1 = new BorderLayout();  //Construct the frame
      public MyFram() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      //Component initialization
      private void jbInit() throws Exception  {
        image1 = new ImageIcon(MyTest.MyFram.class.getResource("openFile.png"));
        image2 = new ImageIcon(MyTest.MyFram.class.getResource("closeFile.png"));
        image3 = new ImageIcon(MyTest.MyFram.class.getResource("help.png"));
        contentPane = (JPanel) this.getContentPane();
        contentPane.setLayout(borderLayout1);
        this.setSize(new Dimension(400, 300));
        this.setTitle("Frame Title");
        statusBar.setText(" ");
        jMenuFile.setText("File");
        jMenuFileExit.setText("Exit");
        jMenuFileExit.addActionListener(new MyFram_jMenuFileExit_ActionAdapter(this));
        jMenuHelp.setText("Help");
        jMenuHelpAbout.setText("About");
        jMenuHelpAbout.addActionListener(new MyFram_jMenuHelpAbout_ActionAdapter(this));
        jButton1.setIcon(image1);
        jButton1.setToolTipText("Open File");
        jButton2.setIcon(image2);
        jButton2.setToolTipText("Close File");
        jButton3.setIcon(image3);
        jButton3.setToolTipText("Help");
        jToolBar.add(jButton1);
        jToolBar.add(jButton2);
        jToolBar.add(jButton3);
        jMenuFile.add(jMenuFileExit);
        jMenuHelp.add(jMenuHelpAbout);
        jMenuBar1.add(jMenuFile);
        jMenuBar1.add(jMenuHelp);
        this.setJMenuBar(jMenuBar1);
        contentPane.add(jToolBar, BorderLayout.NORTH);
        contentPane.add(statusBar, BorderLayout.SOUTH);
      }
      //File | Exit action performed
      public void jMenuFileExit_actionPerformed(ActionEvent e) {
        System.exit(0);
      }
      //Help | About action performed
      public void jMenuHelpAbout_actionPerformed(ActionEvent e) {
        MyFram_AboutBox dlg = new MyFram_AboutBox(this);
        Dimension dlgSize = dlg.getPreferredSize();
        Dimension frmSize = getSize();
        Point loc = getLocation();
        dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
        dlg.setModal(true);
        dlg.pack();
        dlg.show();
      }
      //Overridden so we can exit when window is closed
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          jMenuFileExit_actionPerformed(null);
        }
      }
    }class MyFram_jMenuFileExit_ActionAdapter implements ActionListener {
      MyFram adaptee;  MyFram_jMenuFileExit_ActionAdapter(MyFram adaptee) {
        this.adaptee = adaptee;
      }
      public void actionPerformed(ActionEvent e) {
        adaptee.jMenuFileExit_actionPerformed(e);
      }
    }class MyFram_jMenuHelpAbout_ActionAdapter implements ActionListener {
      MyFram adaptee;  MyFram_jMenuHelpAbout_ActionAdapter(MyFram adaptee) {
        this.adaptee = adaptee;
      }
      public void actionPerformed(ActionEvent e) {
        adaptee.jMenuHelpAbout_actionPerformed(e);
      }
    }
      

  7.   

    问题解决,是由于我运行了天网防火墙,停掉防火墙后,JBudile正常。下面是我在国外的论坛找到的资料,希望对其他人有用。
    to li_haizhou:
    虽然问题解决,但是我还是希望你能详细说明下Project properties和Default Project properties的区别,以及RunTime Configurations的含义,谢谢
    ----------------------------------------------------------------------------------
    do you trying to debug the application ? sounds like debugger error.  
    Comment from guidway  12/10/2002 06:29AM PST  
    You're on the right track! I just tried it in run mode and it works fine. I'm so used to running it in debug mode I didn't think about just running it. Any ideas though why I can't debug it? I'm sure I will need this eventually. thanks
    ----------------------------------------------------------------------------------
    not sure but it seems that some subsystem does not start (debugger or whatever). maybe it is caused by some CLASSPATH mess ... mixing several Java versions ... do not know ... you can try to make new clean install  
    ----------------------------------------------------------------------------------
    still haven't gotten the problem solved but looking through another forum I found some stuff that might help others with this problem. Things to try:1)Make sure your computer name contains both digits and numbers and that the computer name begins and ends with a digit (alpha numeric character).2)Make sure your computer name doesn't have any periods that begin the name (or any other punctuation s at that). 3)If running a firewall try to disable it and see if it works. These are things others did and this same problem was solved for them. Maybe it will be helpful to others. I'm still looking for a solution to mine though. :-(thanks for your help
    ----------------------------------------------------------------------------------Something to do with a debugging process that starts a server instance (or something) on your computer to run the debugging. It is very picky about the things I mentioned above. It will crash if things are not setup perfectly. Have any ideas what else would cause this not to run. Computer name is out. In fact I don't have networking (tcp/ip)installed on my computer. Could that be causing this?----------------------------------------------------------------------------------> Computer name is out. In fact I don't have networking (tcp/ip)installed on my computer. Could that be causing this?for sure. afaik debugging works over TCP.  
    ----------------------------------------------------------------------------------That did it. Thanks! Needed a network protocol and adapter configured. Ran it through the network installer on NT and it worked. 
      

  8.   

    to by92419,
    ^_^,让我开眼界了!
    居然会是防火墙的影响!
    1,“说明下Project properties和Default Project properties的区别”
    Project properties是对当前项目(Project)的,Default Project properties是项目的默认属性。
    也就是说:修改当前项目的属性的话,必须修改Project properties;而修改Default Project properties不会影响当前项目的属性。
    但是当你新建项目时,新的项目会使用Default Project properties的属性。
    2,“以及RunTime Configurations的含义”
    就是运行时环境配置。
    是指运行时的一些系统参数配置,例如运行的是那个类,有什么参数等。在Java中,dt(Design Time,设计时)和rt(RunTime,运行时)是很常见的两个概念,不仅Sun的文档中经常会提及这两个概念,而且在JDK中也有体现。C:\jdk1.3.1_06\lib\dt.jar文件包含设计时类库,里面都是javax.swing下面的BeanInfo类,这些类都是在界面设计(GUI)时,提供控件的信息的。
    你在JBuilder中,Design页编辑GUI画面,能够看到每个控件的属性和事件,除了JavaBeans规范能够提供的信息外,就是依靠这些类了。C:\jdk1.3.1_06\jre\lib\rt.jar包含所有运行时类库,必须加入CLASSPATH才能够在DOS下运行java程序,所以这个文件可能你已经很熟悉了。
    3,“请问结贴时说:贴子回复次数大于跟给分次数,是什么意思”
    不是次数吧?我猜想可能是说分数,也就是说,你在回复帖子后面填的分数,不能大于这个帖子的总分数80分。
    4,“下面是我在国外的论坛找到的资料”
    是那个论坛?
    我最喜欢的是JavaRanch,那上面的老外水平非常高,并且人特别谦虚,不管你问什么稀奇古怪的问题,他们都会很耐心的回答,而且很少有他们回答不出来的问题。
    并且那些老外非常尊重提问题的人,会很谦虚的给你几种解决方案,不会因个人喜好,而对提问的人不屑一顾。
      

  9.   

    不好意思,我使用Goolgo搜索的,具体的地址没有记。非常感谢!