的确是要用HTML,但是不是向上面的哥们说的那样用:
String[] data = {"one","{"two","three","four","five"};
JList list = new JList(data);
这样就可以了
JList list = new JList();
list.setForeground(Color.red);
需要用到HTML
String[] data = {"onehtml>","{"two","three","four","five"};
JList list = new JList(data);
这样就可以了!
java里面其实可以嵌入html代码的
JList list = new JList(“”);
还可以这样啊,
st list = new JList(FONT.);
.后面是字体类型