rt
谢谢

解决方案 »

  1.   

    css处理下就可以了,具体我也不会
      

  2.   

    <textarea name="aaa" style="color:   #FF0000">12346</textarea>   
      

  3.   

    使用javasrcipt:document.getElementById('a').select();就这么一句就可以使他高亮了
      

  4.   

    可能是我没说清楚,是在java中的TextArea
      

  5.   

    设置对应的foreground, background就行了吧
      

  6.   

    与JScrollPane结合起来用就可以啦。例如:
    import java.awt.*;
    import javax.swing.*;class JPanelTest extends JFrame{
    JButton cl,sa,ex;
    JPanel p1,p2;
    JTextArea t;
    public JPanelTest() {
    super("面板示例");
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    testInit();
    Container cc=getContentPane();
    cc.setLayout(new FlowLayout());
    cc.add(p1);
    cc.add(p2);
    this.setSize(350,150);
    this.setVisible(true);
    }
    void testInit(){
    cl = new JButton("Clear");
        sa = new JButton("Save");
        ex = new JButton("Exit");
        t=new JTextArea(5,20);
    //     t.setLineWrap(true);
        p1=new  JPanel(new GridLayout(3,1,5,5));
        p2=new  JPanel();
    p1.add(cl); p1.add(sa);p1.add(ex);
    p2.add(new JScrollPane(t)); }
    public static void main(String[] args) {
    new JPanelTest();
    }
    }