JEditorPane
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ERKAN_AYAZ
Posted On:   Tuesday, June 24, 2003 12:53 AM

I hava such a code below: //----------------------------------------- pos = stat.getCaretPosition(); end = pos + stat.toString().length() + 1; try { source.setCaretPosition(pos); source.moveCaretPosition(end); vd().getMessagePage().sendMessage("Code executed: " + stat.toString()); } catch (Exception exp) { vd().getMessagePage().sendMessage("Exception in selection"); } //---------------------------------------------- My program finds the required integer values (pos,end) correctly, but following code; //------------    More>>

I hava such a code below:

//-----------------------------------------

pos = stat.getCaretPosition();

end = pos + stat.toString().length() + 1;

try {

source.setCaretPosition(pos);

source.moveCaretPosition(end);

vd().getMessagePage().sendMessage("Code executed: " +

stat.toString());

} catch (Exception exp) {

vd().getMessagePage().sendMessage("Exception in selection");

}

//----------------------------------------------


My program finds the required integer values (pos,end) correctly, but following code;

//------------

source.setCaretPosition(pos);

source.moveCaretPosition(end);
//------------
cannot select the given position. I use jdk1.4.1.

Please help

   <<Less
About | Sitemap | Contact