⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1000. using the selection of a jtextcomponent.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
JTextComponent c = new JTextArea();
    
    // Get text inside selection
    c.getSelectedText();
    
    // Replace selected text
    c.replaceSelection("replacement text");
    
    // Set the start of the selection; ignored if new start is < end
    c.setSelectionStart(10);
    
    // Set the end of the selection; ignored if new end is > start
    c.setSelectionEnd(20);
    
    // Better way to set the selection
    c.select(10, 20);
    
    // Set the color of text inside the selection
    c.setSelectedTextColor(Color.red);
    
    // Set the color behind the selected text
    c.setSelectionColor(Color.green);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -