Skip to content

Commit 464b96b

Browse files
Update ImprovedTextEditor.java
1 parent f1090c3 commit 464b96b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ImprovedTextEditor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ public static void main(String[] args) {
283283
}
284284
}
285285

286+
/*
287+
* THIS FEATURE MAY NOT WORK ON SOME SYSTEMS
288+
*/
286289
// Class for syntax highlighting
287290
class SyntaxHighlighter {
288291
// Method to highlight keywords in the text area
@@ -303,7 +306,7 @@ private static void highlightWord(JTextArea textArea, String word, DefaultHighli
303306
try {
304307
textArea.getHighlighter().addHighlight(pos, pos + word.length(), painter);
305308
// Change the foreground color
306-
textArea.setSelectionColor(Color.BLUE);
309+
textArea.setSelectionColor(Color.GREEN); // Set Custom color here
307310
pos += word.length();
308311
} catch (BadLocationException e) {
309312
e.printStackTrace();

0 commit comments

Comments
 (0)