Results 1 to 5 of 5
  1. #1
    poajavaweb is offline Member
    Join Date
    Dec 2010
    Location
    Dallas
    Posts
    10
    Rep Power
    0

    Default applet and textfields

    I have an applet where I display rows of data using JtextField,
    I have disable the fields so the users can't change the data. which turn the field gray - uneditable.

    Is there a way to disable a field and allow me to change the text to the color Red.
    I tried setcolor(red) on the disabled field - but they are still gray on white:eek:
    Last edited by poajavaweb; 01-28-2011 at 04:11 PM.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    Read the API for JTextField, in particular the setForeground method which accepts a Color as a parameter.

  3. #3
    poajavaweb is offline Member
    Join Date
    Dec 2010
    Location
    Dallas
    Posts
    10
    Rep Power
    0

    Default

    Have already tried setForeground setBackground setColor. still gray on white

  4. #4
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    Quote Originally Posted by poajavaweb View Post
    Have already tried setForeground setBackground setColor. still gray on white
    Then you will have to post an SSCCE which demonstrates the problem clearly, because the above works for me

  5. #5
    poajavaweb is offline Member
    Join Date
    Dec 2010
    Location
    Dallas
    Posts
    10
    Rep Power
    0

Similar Threads

  1. adding textfields
    By themanepalli in forum Java Applets
    Replies: 1
    Last Post: 12-28-2010, 04:56 AM
  2. How to validate textfields if data is modifier
    By sasi.tati in forum AWT / Swing
    Replies: 1
    Last Post: 07-26-2010, 10:10 AM
  3. Buttons and TextFields
    By Xystus777 in forum New To Java
    Replies: 27
    Last Post: 03-17-2009, 02:26 AM
  4. Replies: 0
    Last Post: 02-12-2009, 12:12 AM
  5. information from a textfields
    By bbq in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-28-2007, 06:28 PM

Posting Permissions

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