Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to change cursor of Edit Text

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default How to change cursor of Edit Text

    I set the cursor of Edit Text in activity_main.xml in android

    android:textCursorDrawable="@drawable/large_cursor"

    I want to change the cursor to "@drawable/small_cursor" BY JAVA CODE. Can anyone know what JAVA CODE to do this task?

  2. #2
    Junior Member
    Join Date
    Nov 2020
    Location
    Surat
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to change cursor of Edit Text

    Setting the android:textCursorDrawable attribute to @null should result in the use of android:textColor as the cursor color.
    Attribute "textCursorDrawable" is available in API level 12 and higher

Similar Threads

  1. Change The Mouse Cursor In Java
    By Nemesis89 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: February 24th, 2014, 12:50 PM
  2. How do I change the color of my cursor?
    By Chokladmunken in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 17th, 2014, 10:54 AM
  3. Display an image after mouse cursor point on a text area
    By samseah123 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: July 19th, 2013, 02:24 PM
  4. Show Text With cursor
    By ravjot28 in forum AWT / Java Swing
    Replies: 1
    Last Post: January 20th, 2010, 10:02 AM