Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将文本添加到绘制的矩形中。
canvas.fillRect(...)
但我希望用户为此矩形输入自定义文本。但是如何在 gwt 画布中创建一个可以接受用户输入的可编辑标签?
我想在 gwt canvas JAVA 中实现这一点!不是JS。
这里的拉绳方法可能有一些用处:)
http://www.c-point.com/javascript_vector_draw.htm
1) 创建一个与 Graphics.fillRect() 位置相同的 JTextField。
JTextField txtSomething = new JTextField(...) 2) Make the JTextField background transparent.
JTextField txtSomething = new JTextField(...)
2) Make the JTextField background transparent.
txtSomething.setBackground(new Color(0,0,0,0))
3) 运行
还有其他方法可以做到这一点,尝试研究