|
From: Peter De B. <pet...@gm...> - 2007-09-07 10:15:12
|
On 9/7/07, Rogan Dawes <ro...@da...> wrote: > > Andy DePue wrote: > > If this is a Swing "feature", then I'm not aware of a simple setting > > somewhere (maybe someone else knows of one?). I do know that > > DefaultCaret has a setUpdatePolicy method. You would have to get the > > Caret from the JTextField, make sure it is a DefaultCaret, cast it to > > DefaultCaret, and invoke setUpdatePolicy(DefaultCaret.NEVER_UPDATE). > > Even then, I haven't tested this, so I'm not sure if it would have the > > desired effect. Another approach would be to implement a > > FormComponentInterceptor that automatically handles any JTextField that > > is not enabled so that the caret it always placed at the beginning of > > the field. See SelectAllFormComponentInterceptorFactory for an example > > of what an interceptor looks like. > > > > - Andy > > How about calling > > http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/JTextComponent.html#setCaretPosition(int) > > with a value of 0 after setting the text? exactly, But what better place to do this than in a FormComponentInterceptor? Rogan > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Springframework-rcp-dev mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev > |