how to make java run time sizable image box

╄→гoц情女王★ 提交于 2019-12-11 16:05:27

问题


I'm making a Unicode translator in Java. I did all hard parts, but now I want to add a resizable, relocatable image to the textpane. The user must be able to resize image with its corners and drag & drop the image within the textpane where he likes. (like Microsoft Word or Photoshop)

Something like this:

I tried the Styled Document properties. But I couldn't find way except inserting only an ImageIcon.


回答1:


May be a better choice would be not to use textPane.

If you have an custom editable label, that can be edited by double clicking on it to show a text box to edit the contents, and change the text of the label when enter key is pressed.

Also give a shot of JDesktoppane, JLayeredPane, and check what components can be added to it.




回答2:


try this http://mgeisler.net/downloads/browser/src/ImageBox.java.html




回答3:


try loading the image inside a JLabel component in JFC Swing. Otherwise try some other non editable components in the same technology with resizable property.




回答4:


try this http://sourceforge.net/projects/ird/
the iRD is a component for Resize and move(drag&drop) compoennts on runtime in java.



来源:https://stackoverflow.com/questions/6288064/how-to-make-java-run-time-sizable-image-box

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!