我想在弹出菜单中实现: 在当前光标处插入日期/时间,就像Windows的记事本一样,但是当我看javaAPI的时候发现JTextArea类有insert()函数,函数声明如下:public void insert(String str,int pos)API中对函数功能的解释是:Inserts the specified text at the specified position. Does nothing if the model is null or if the text is null or empty. 对两个参数的说明是:
Parameters:
str - the text to insert
pos - the position at which to insert >= 0 可是要怎样才能获取当前光标的位置呢?