0

What I am looking for is, adding numerous components to a scene, and make them resizable and movable, so user will design them as his needs, then I will find their coordinates and use these information later, etc.

However when I come to add components to scene, i had a confusion. As far as I understand, I have two options, either use JComponents inside ComponentWidget, or use images inside IconWidget.

Using ComponentWidget has some problems,

  • ComponentWidget doesn't become movable by adding ActionFactory.createMoveAction(). I guess, mouseListeners of component itself doesnt let this action work. You have to add a mouseListener and escalate events to action. I have learned this tip from http://barenka.blogspot.com/2008/09/visual-library-and-multiline-label.html However this solution doesn't react as fast as expected.
  • All standard behaviors of components come along, like JComboBox expands when you click its button, which is unacceptable on editor mode.

IconWidget has other types of problems, like resizing the image etc.

So based on this, what i need is a widget that looks like real component, but behaves like (almost) image.

Any advice...

4

1 回答 1

1

Java ME 应用程序流设计器使用可视化设计器,因此如果您愿意,可以深入研究该源代码并查看它们是如何实现的。

或者,如果您查看NetBeans 可视化数据库资源管理器教程,他们使用VMDNodeWidget

于 2011-05-18T19:25:20.483 回答