Java MS Word 类应用程序

发布于 2024-08-24 12:10:11 字数 163 浏览 2 评论 0原文

你知道在 MS Word 中,你可以在任何你想要的地方编写文本并绘制​​和放置形状。在文本中,当你按 Enter 并进入新行时,光标下方的形状也会向下移动一行?我想在窗格上用 Java 实现该属性,使用组件作为形状和文本。如何为形状提供绝对定位,同时保留它们之间的空间?我会很感激任何想法,因为我几乎没有想法了。

You know in MS Word, you can write text and draw&put shapes anywhere you want.. in the text when you hit enter and get to a new line, the shapes below your cursor also moves down one line? I want to implement that property in Java on a pane, using components as the shapes and text. How can I provide absolute positioning for shapes but at the same time preserve the space between them? I'll appreciate any idea, cause I'm almost out of ideas.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不念旧人 2024-08-31 12:10:11

也许你可以使用SpringLayout

Spring 布局通过定义组件边缘之间的方向关系或约束来完成其工作。例如,您可以定义一个组件的左边缘距另一组件右边缘的固定距离(例如 5 个像素)。

Maybe you could use SpringLayout?

Spring layouts do their job by defining directional relationships, or constraints, between the edges of components. For example, you might define that the left edge of one component is a fixed distance (5 pixels, say) from the right edge of another component.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文