Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

textfield background  RSS feed

 
Dalibor Toth
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Can anyone tell me how to set textfield background to "white". When i change background of my applet to red, the textfields turns red too. I want them to stay white. I also have a choice, which stays white on applet background change.
Why?
Best regards,
bye
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your code? I tried to recreate the problem you described based off your description, and it didn't happen... the applet has a red background, but the textfield still has a white background...

Also, could you say what platform and version of Java you are working with? I remember a similiar problem I had at one point with AWT comboboxes on the solaris platform... setBackground and setForeground didn't set the areas of the combobox that you would think they pertained to... if this is the problem usually the only solution is to use Swing...

-Nate
[This message has been edited by Nathan Pruett (edited July 16, 2001).]
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Check the setOpaque property of the textfield. If it is set to false, then it tends to gain the background color of the container(in your case applet). Try setting the TextField opaque property to true.
Meghna
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!