要能适应各种情况的IDE工具是不可能有的,你自己写的基类JB的设计器是无法识别的。你的程序没什么错误,别担心。

解决方案 »

  1.   

    //父类
    public class WorkInternalFrame extends JInternalFrame {
      //设置属性
      private JPanel panel = new JPanel(new GridLayout(0,1));//FlowLayout());//
      protected JPanel bottom = null;
      protected JPanel tree = null;
      protected JSplitPane split = new JSplitPane();
      protected Font font = new Font("china",Font.PLAIN,14);
      protected Color color = Color.blue;  //带参数的构造方法
      public WorkInternalFrame(String title) {
        super( title, true, true, true, true );
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      //初始化窗口
      private void jbInit() throws Exception {
        getContentPane().setLayout(new BorderLayout());
        this.getContentPane().add(panel, BorderLayout.NORTH);
        setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
      }
    }
    //他的子类是
    public class LayoutInternalFrame extends WorkInternalFrame {
      public LayoutInternalFrame(){
        super("工作规划");
        ToolBarFactory factory = (ToolBarFactory)LayoutToolBarFactory.newInstance();
        addToolBars(factory.getToolBars());
        split = new JSplitPane(1,new JLabel("1"),new JLabel("2"));
        split.setDividerLocation(200);
        getContentPane().add(split,BorderLayout.CENTER);
        // add listener for InternalFrame events
        addInternalFrameListener(
           new WorkInternalFrameListener() );
      }
    }