为JTextpane添加内容辅助 [英] Adding Content Assist For JTextpane

查看:76
本文介绍了为JTextpane添加内容辅助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



现在,我正在尝试使用Java Swing开发工具.
我已经使用JTextpane作为我的工具的编辑器.现在,我想为此JTextpane添加Content辅助,以便我可以轻松键入.我的目的是通过键入一个或两个字符来提供与我的工具相关的所有对象和功能的列表.
有什么方法可以在JTextpane中实现内容辅助吗?
有人可以帮我吗?
在此先感谢...

Hi,

Now I am trying to develop a tool using Java Swing.
I have used JTextpane as editor of my tool. Now I want to add Content assist for this JTextpane ,so that I can easily type. My purpose is to provide listing of all objects and functions related to my tool by just typing one or two charcters.
Is there any way to implement content assist in JTextpane ?
Can any one help me for this?
Thanks in advance......

推荐答案

给定的东西可能会对您有所帮助.
取一个可编辑的组合框而不是文本字段.
将您要支付的所有项目添加到组合框中.您可能会从数据库中获得甚至是硬编码的这些项目.

现在,由于组合框是可编辑的,因此允许用户输入文本.
在组合上输入垂直文本时,只需从组合中获取所有带有输入字符的条目并显示在同一组合上即可.

例如自动补全Visual Studio或Javbeans
Hey given thing may help you.
Take a Editable ComboBox instead of Textfield.
Add all item that you want to dispay into combobox. This items you may took from data base or even hardcoded.

now as combobox is editable that allows user to enter text.
on enter perticular text on combo just take all entries from commbo intiate with entered character and shown on same combo.

like auto complition of visual studio or javbeans


这篇关于为JTextpane添加内容辅助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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