如题
 本人做个查找替换,还有关键字变色的东东,有此经验的朋友,请告诉我你们的思路和技术材料,谢谢
没分了,各位将就点,就当是学雷锋好了……

解决方案 »

  1.   

    textPane.addCaretListener(new caretListener());class caretListener implements CaretListener{
          public void caretUpdate(CaretEvent e){
                 System.out.println(e.getDot());//输出光标位置
                          ……                  //实现你所需的功能代码
          }
    }
      

  2.   

    int cursorPos = this.getCaretPosition();