我在网站上做了一些研究,我了解到当使用突出显示文本的程序时,无论我在哪里这样做,我都应该使用JTextArea或JEditorPane,甚至是JTextPane。请给我一些建议,我应该使用哪些来设置突出显示的字符串变量 IN JAVA 以及我应该使用哪些方法。
我的尝试......
import javax.swing.JFrame;
import javax.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class windowOfCount {
public static void main(String[] args) {
JFrame frame = new JFrame("Count");
frame.setAlwaysOnTop( true );
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(100,100);
}
/*public Object selectionListener() {
}*/
}