开发者

Drag and Drop Java GUI [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

I am looking to create a GUI in Java, where I place controls or elements on a left pan开发者_如何学JAVAe and can drag them onto a designer pane, similar to creating a model in Visio.

The current one I'm looking at is JGraphX, it allows you to create graphs etc.

Are there any other projects out there that support this, or tools etc.


While it seems to be a good idea at first glance to create a UI with drag and drop, I always found that the UI editors made me much less productive than writing the code by hand:

  1. The property editor for UI elements always shows 150 properties which I don't need and I have to scroll every time to get the one I always change.
  2. Changing properties needs too many clicks with the mouse (and sometimes the aim of a world class StarCraft player)
  3. There is no way to reuse common things like colors, texts, initialization
  4. The resulting code it a large, unreadable mess without structure
  5. There is no code completion


WindowBuilder (Swing, SWT, GWT etc.) was a commercial product before Instantiatons was acquired by Google and has been proposed as a new project to the Eclipse Foundation. While you'll certainly always have the greatest flexibility with hand coding (like Aaron suggests in his answer) I have had a lot of great experience with the tool.

The project is in Eclipse Incubation currently, but has been used in production for years. If you want to create a GUI with Drag'n'Drop you should definitely have a look at WindowBuilder.


There are few GUI builders available.

--> Netbeans

--> SpeedJG

--> IntelliJIdea

--> Eclipse


JGraphx has a nice example called editor that does exactly what you are trying to accomplish. Just look in the downloaded zip file in the /examples/com/mxgraph/examples/swing/editor - there is everything you need.

Alternatively you might want to use JUNG http://jung.sourceforge.net/. For this one see the following demo - it might give you some clues: http://jung.sourceforge.net/applet/grapheditordemo.html


Perhaps look at the Eclipse Modelling Framework. It is a good starting point for a modeling tool.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜