aspose file tools
The moose likes Swing / AWT / SWT and the fly likes textfield background Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "textfield background" Watch "textfield background" New topic
Author

textfield background

Dalibor Toth
Ranch Hand

Joined: Jul 16, 2001
Posts: 38
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

Joined: Oct 18, 2000
Posts: 4121

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).]


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Meghna ks
Ranch Hand

Joined: Mar 15, 2001
Posts: 122
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: textfield background
 
Similar Threads
some pictures
Change background
Applet BackGround
How to design this part?
cant change background color of applet with button click