java-通过数字行使用JTextArea插入文本 [英] java - inserting text using JTextArea by number line

查看:144
本文介绍了java-通过数字行使用JTextArea插入文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我来说,我想通过数字行在JTextArea中插入文本.

For my case, I want to insert text inside JTextArea by number line.

例如

name : andy
birth : jakarta, 1 jan 1990
number id : 01011990 01
age : 26
study : Informatics engineering

所以,我想在第3行的最后一个位置插入文本.

So, I want to insert text in last position in line 3.

我认为我可以使用: jTextArea.getDocument.insertString(3," my text here".null);
但它不起作用.

I think I can use: jTextArea.getDocument.insertString(3," my text here".null);
but it doesn't work.

所以,我希望我的输出像这样.

So, I wish my output to be like this.

name : andy
birth : jakarta, 1 jan 1990
number id : 01011990 01 my text here
age : 26
study : Informatics engineering

推荐答案

您可以使用

这篇关于java-通过数字行使用JTextArea插入文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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