Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2014
    Posts
    7
    Rep Power
    0

    Default make a textview deactive

    Hi dears
    how can I desable a textview after count some digit
    for example I have a textview, it count from 0 to 100, now if counter is 100 should textview get disable...
    how can I do that?
    thanks

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    911
    Rep Power
    2

    Default Re: make a textview deactive

    You don't give much to work with, so you have to with this:
    Java Code:
    if ( counter == 100)  {
       textview.setEnabled(false);
    }
    There is no such thing as a textview in Java. Known classes that are possibly what you want are JTextField, JTextArea and JTextPane.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: make a textview deactive

    Is this an Android question?
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    Join Date
    Apr 2014
    Posts
    7
    Rep Power
    0

    Default Re: make a textview deactive

    yessssssssss
    Last edited by amirnazarizadeh; 04-02-2014 at 10:56 PM.

  5. #5
    Join Date
    Apr 2014
    Posts
    7
    Rep Power
    0

    Default Re: make a textview deactive

    yes dear

  6. #6
    Join Date
    Apr 2014
    Posts
    7
    Rep Power
    0

    Default Re: make a textview deactive

    [QUOTE=SurfMan;377086]You don't give much to work with, so you have to with this:
    Java Code:
    if ( counter == 100)  {
       textview.setEnabled(false);
    }

    yes
    its correct but if I click button it yet add 1 to it
    I want to lock it and fix in a number.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,798
    Rep Power
    19

    Default Re: make a textview deactive

    Store the number somewhere.
    When the button is clicked, check the number, if it's < 100 then increment and set the value of the view (I would personally use a Label unless you need to allow the user to be able to edit the field) to the stored number. Otherwise don't.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 2
    Last Post: 10-31-2012, 04:31 PM
  2. What do I need to make this?
    By Sonicfr in forum New To Java
    Replies: 8
    Last Post: 05-16-2012, 08:18 PM
  3. Replies: 4
    Last Post: 07-23-2011, 08:08 PM
  4. how do i make a jar to an exe?
    By jack13580 in forum New To Java
    Replies: 23
    Last Post: 12-19-2010, 04:15 AM
  5. Trying to make a bot
    By ighor10 in forum New To Java
    Replies: 4
    Last Post: 04-10-2010, 03:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •