问题
I'm try to make a notification. I saw a little tutorial but something is not working for me.
JLabel messageLabel = new JLabel('<HtMl>'+message);
"Invalid Character Constant"
Why is this error occurring?
回答1:
You need double quotes the single quotes is for char literals.
JLabel messageLabel = new JLabel("<HtMl>"+message);
or
JLabel messageLabel = new JLabel('l'+message);
回答2:
You should use double quotes instead of single quotes to resolve your problem.
来源:https://stackoverflow.com/questions/41432855/java-invalid-character-constant-error-occurring