3 Replies - 3194 Views - Last Post: 30 March 2011 - 09:40 AM Rate Topic: -----

#1 farasu123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 20-January 11

Set cursor in textfield

Posted 25 March 2011 - 11:41 AM

Hi guys

I have using one jformattedtextfield for get date of birth value, after check this date value if it is not valid
date then i have set cursor in that particular jformattedTextField.. Please help me to do this.. anybody please
Is This A Good Question/Topic? 0
  • +

Replies To: Set cursor in textfield

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10180
  • View blog
  • Posts: 37,585
  • Joined: 27-December 08

Re: Set cursor in textfield

Posted 25 March 2011 - 03:09 PM

You can use the grabFocus() method the JFormattedTextField objects inherit from JComponent to do this.
Was This Post Helpful? 3
  • +
  • -

#3 sakshamkum  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 19
  • View blog
  • Posts: 232
  • Joined: 09-June 09

Re: Set cursor in textfield

Posted 26 March 2011 - 06:33 AM

there is a setCarat() method in JTextField but confirm it in JFormattedTextField

there is a setCarat() method in JTextField but confirm it in JFormattedTextField
Was This Post Helpful? 1
  • +
  • -

#4 ericzmeh  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 56
  • Joined: 13-September 09

Re: Set cursor in textfield

Posted 30 March 2011 - 09:40 AM

Like macosxnerd said, setting the focus to a field is probably the best way to go about it. And remember it's always helpful to post your code :-]
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1