如何在JEditorPane中的单词下制作红色曲折 [英] How to make a red zig zag under word in JEditorPane

查看:116
本文介绍了如何在JEditorPane中的单词下制作红色曲折的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Java中为我正在创建的应用程序创建一个简单的拼写检查程序,并且我已经搜索过,并且没有找到任何直接和重点答案。

I need to make a simple spell checker in Java for an application that I am creating and I have searched around and have not found any straight and to the point answers.

如何在 JEditorPane 中使用红色曲折下划线?像这样:

How do I make a word in JEditorPane get underlined with a red zig-zag? Like this:

如果任何人有任何简单且相当容易实现的想法,请您与我分享。甚至可能是一些代码的链接。

Please if any one has any simple and fairly easy to implement ideas please would you share them with me. Maybe even some links to some code.

推荐答案

你可能会发现这个自定义编辑器工具包示例很有用。它显示了如何扩展 StyledEditorKit 以添加属性以绘制自定义下划线。

You may find this custom editor kit example useful. It shows how to extend StyledEditorKit to add attribute to draw custom underline.

如果您需要完整的解决方案,可以使用Jide的 StyledLabel 。请查看此处。它应该是 jide-oss 的一部分 - 常见的开源库。

If you're up for a complete solution you can go with Jide's StyledLabel. Check it out here. It should be part of jide-oss - common open source library.

这篇关于如何在JEditorPane中的单词下制作红色曲折的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆