0
A
回答
1
Swing組件
JTextArea txt = new JTextArea();
//Set background black
txt.setBackground(Color.BLACK);
//Set Foreground(text) white
txt.setForeground(Color.WHITE);
規則同樣適用於AWT組件
TextArea txt = new TextArea();
//Set background black
txt.setBackground(Color.BLACK);
//Set Foreground(text) white
txt.setForeground(Color.WHITE);
的setForeground
和setBackground
方法屬於JComponent
/Component
類因此accessibl e傳遞給每個組件,因爲所有Swing/AWT組件在層次結構的某個位置將擴展這些類。
3
試試這個..
JTextArea txt = new JTextArea();
txt.setBackground(Color.BLACK);
txt.setForeground(Color.WHITE);
+0
謝謝......我包括它...... – 2012-07-22 17:25:17
+0
非常感謝,它幫助! – 2012-07-23 10:20:26
相關問題
- 1. Java swing。如何將顏色強度從黑色變爲白色?
- 2. 將actionscript textarea顏色設置爲黑色
- 3. 如何使柱爲黑色
- 4. 使綠色的nullsrc變黑
- 5. 如何將顏色從白色變爲黑色?
- 6. UIColor自動變爲黑色
- 7. Java BufferedImage:Alpha變更使低阿爾法區域顯示爲黑色
- 8. objectlistview背景顏色變爲黑色
- 9. 如何使用黑色漸變爲iPhone創建UIButton?
- 10. 的UIImageView變黑顏色,使黑色的所有其它圖像
- 11. 如何擺脫火狐文本和TextArea上的黑色邊框?
- 12. 如何將黑色更改爲白色
- 13. 如何讓圖像中的某種顏色變成黑色?
- 14. 的Java的ImageIO - JPEG黑人變爲灰色
- 15. 當影片剪輯動畫變黑時,如何讓對象變爲黑色?
- 16. Java旋轉圖像變成全黑色?
- 17. Imagick - 使黑色背景變成白色
- 18. 使圖像變成黑色和白色?
- 19. 在Chrome上Textarea大綱只是黑色
- 20. 狀態欄色調顏色變爲黑色在iOS 6中
- 21. 如何使用ExtendScript將InDesign文檔中的所有文本變爲黑色?
- 22. 空的畫布toDataURL()變爲黑色
- 23. 如何使文本和圖標在粘頭中變成黑色?
- 24. 爲什麼AmCharts導出顏色變爲黑色和白色?
- 25. 如何識別C#中的黑色或黑色圖像?
- 26. 在elixir REPL(在emacs外殼中)如何將黃色變爲黑色?
- 27. 如何將SharpDevelop中的顏色更改爲黑色主題?
- 28. 漸變變成黑色
- 29. 爲黑色
- 30. 如何更改Java中GUI的顏色,例如Spotify的桌面應用程序的顏色爲黑/灰色?
Swing? AWT?還有別的嗎? – 2012-07-22 17:21:48