菜虫的问题,如何在JTextArea中改变字体的颜色?多谢了! 试试: JTextArea textArea=new JTextArea("some text"); textArea.setForeground(Color.orange); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试过了,成功!import java.awt.*;import javax.swing.*;public class TextAreaTest extends JFrame{ JTextArea textArea=new JTextArea(" some text"); public TextAreaTest() { Container con=getContentPane(); con.add(textArea,BorderLayout.CENTER); textArea.setForeground(Color.orange); setBounds(100,100,200,200); show(); } public static void main(String[] args) { new TextAreaTest(); }} 不可能,要不然就别用JTextArea 怎样替换字符串 应用服务器的具体作用 请问如何实现窗口的加长与收缩? 请问一个简单的问题,这里的say $+$getnumber表示什么意思? 用Java语言开发,可是却一直连接不上在本地计算机内安装的oracle数据库,请高手进来详阅,帮帮忙,快急疯了,谢谢各位了!!!! 可否人为制造空闲变相令java执行垃圾回收先~ 求阴历和阳历互化的算法! 字符串的处理 如何判斷List是否為空呢? 怎么把JSP页面下的对象发往后台程序? 用法java是否可以实现底层协议,如链路层协议,ip,tcp协议 还是不懂,,我太笨了。。惩罚自己抛点分数:(
import java.awt.*;
import javax.swing.*;
public class TextAreaTest extends JFrame
{
JTextArea textArea=new JTextArea(" some text");
public TextAreaTest()
{
Container con=getContentPane();
con.add(textArea,BorderLayout.CENTER);
textArea.setForeground(Color.orange);
setBounds(100,100,200,200);
show();
}
public static void main(String[] args)
{
new TextAreaTest();
}
}