![]() |
| ||
| JTextArea & Font Color Is there a way to change the color of the text in a JTextArea? I want to change all the text color to one color (other than black) and I just want to know how to do this. I see a lot of methods involving color but they only effect the text "highlighting" portion. |
| ||
| Re: JTextArea & Font Color textArea.setForeground(Color.blue); There might be some mistakes in the Foreground part, I can't remember how to spell right now, nor which letters to capitalize. |
| ||
| Re: JTextArea & Font Color It looks right to me and capitilaztion looks right. |
| ||
| Re: JTextArea & Font Color i agree... |
| ||
| Re: JTextArea & Font Color Where in my code do I put the command to change my font color? I have a slate background on my page and my other text is all in black, but the text from my code does not show up on my page. This is the line from above: [textArea.setForeground(Color.black);] and this is the code for my form: [form method=post action="http://www.comerzcustomz.com" name="emailform" onSubmit="return checkFields()"] [input type=hidden name=to value="chris@comerzcustomz.com"] [input type=hidden name=subject value="Feedback Form"] [pre] Your Name: [input type=text name="name"] (this is the font that I want to change) Your Email: [input type=text name="email"] (this is the font that I want to change) Comments? (this is the font that I want to change) [textarea name="comments" wrap="virtual" rows="7" cols="45"][/Textarea] [input type=submit value="Submit Form!"] [/pre] [/form] |
| ||
| Re: JTextArea & Font Color Hi acomer, This is about Java not HTML for html you need to use CSS This should be your code: [form method=post action="http://www.comerzcustomz.com" name="emailform" onSubmit="return checkFields()"] [input type=hidden name=to value="chris@comerzcustomz.com"] [input type=hidden name=subject value="Feedback Form"] [pre] Your Name: [input type=text name="name" style="color:blue; font:bold 12px Veranda;"] Your Email: [input type=text name="email" style="color:blue; font:bold 12px Veranda;"] Comments?[textarea name="comments" wrap="virtual" rows="7" cols="45" style="color:blue; font:bold 12px Veranda;"]][/Textarea] [input type=submit value="Submit Form!"] [/pre] [/form] The stuff in bold can be changed to what you want it to be |
| ||
| Re: JTextArea & Font Color Try this complete source code : import javax.swing.JTextArea;<URL SNIPPED> |
| All times are GMT -4. The time now is 6:28 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC