Using both Eclipse and NetBeans on the same project

前端 未结 8 1037
忘掉有多难
忘掉有多难 2021-01-31 15:42

Eclipse is a really great editor, which I prefer to use, but the GUI design tools for Eclipse are lacking. On the other hand, NetBeans works really well for GUI design.

相关标签:
8条回答
  • 2021-01-31 15:55

    A few gotchas:

    • If you try to use both without any plugins/integration, you must be careful not to edit the regions marked "DO NOT EDIT" as Netbeans will overwrite code in those sections quite frequently.
    • You should use the "Customize..." command to add custom init code for components.
    • Adding/creating new components on a form using Java code will not be reflected in the GUI editor.
    • Developers have to be discouraged from going into the code and adding swing customizations, effectively bypassing the GUI editor.

    Another tip is that you can create Java Beans using Eclipse and drag-and-drop them into the Matisse editor. This allows you to create a custom GUI component or a non-GUI component (models, listeners, etc) and add it to a Matisse form. With listeners and models, you can specify a component to use an instance of your custom listener/model instead of the default behavior. You can also drag-and-drop in custom GUI components and manipulate them like any other GUI widget.

    0 讨论(0)
  • 2021-01-31 15:58

    Cloud Garden makes a GUI editor called Jigloo that is quite nice if you are into that sort of thing (and the price is very, very reasonable). If that's all that's missing for you from Eclipse, I'd recommend that you take a look. Netbeans does a ton of stuff with source code that you aren't allowed to edit, etc...

    One other thing that I will mention: I have used GUI editors like Matisse and Jigloo for super rapid prototyping. However, within 3 or 4 iterations, I always find myself dropping back to hand coding the layouts. I also find that when I'm doing rapid prototyping, I am almost always more productive when I change the layout manager to absolute and just place components. Once the design starts the gel, implementing the design by hand coding using a good layout manager (I strongly recommend MiG Layout) is pretty easy, and gives much better results.

    I know that dragging and dropping a GUI layout is really enticing - but MiG Layout is incredibly productive for hand wiring GUIs, and I suspect that almost any developer will be more productive within a week going down that path.

    0 讨论(0)
  • 2021-01-31 15:58

    For me using linked source folders works quite well.

    I build the GUIs in independent NetBeans projects - if they need some simple classes or interfaces, I use the "link source" (right click on project in NetBeans, choose properties), to include these in the NetBeans project.

    My main projects are in eclipse. Here I again use the link source feature to link to the NetBeans project (right click on project in eclipse, select "build path", then "link source").

    EDIT (Thx to Milhous :) ): in both projects in eclipse and NetBeans further all required JAR files need to be added to the build path (also the libraries added by NetBeans: eg beansbinding-1.2.1.jar, appframework-1.0.3.jar swing-worker-1.1.jar, ...)

    Now the GUI classes can be reused in eclipse. Also leads to need to have GUI and logic classes quite decoupled, which can be nothing bad.

    0 讨论(0)
  • 2021-01-31 15:59

    Create your GUI with Netbeans. copy a Eclipse .project file (like below) into the project folder change the MyProjectName. Open Eclipse and import the project into your workspace, so you can open the projekt from your Eclipse workspace with Netbeans. Now you able to use Netbeans to create and change the GUI and editing the code with Eclipse.

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
     <name>MyProject</name>
     <comment></comment>
     <projects>
     </projects>
     <buildSpec>
      <buildCommand>
       <name>org.eclipse.jdt.core.javabuilder</name>
       <arguments>
       </arguments>
      </buildCommand>
     </buildSpec>
     <natures>
      <nature>org.eclipse.jdt.core.javanature</nature>
     </natures>
    </projectDescription>
    
    0 讨论(0)
  • 2021-01-31 15:59

    import project in netbeans create gui and then again open the project in eclipse

    it works with no error

    0 讨论(0)
  • 2021-01-31 16:02

    MyEclipse offers an integration of the Netbeans GUI editor (Matisse) with Eclipse.

    See http://www.myeclipseide.com/module-htmlpages-display-pid-5.html

    0 讨论(0)
提交回复
热议问题