Answer the question
In order to leave comments, you need to log in
Why does getLineCount() count differently?
Hello.
In my first graphics program (text editor) I want to display a line counter.
The same line of code counts differently in two cases:
- when the program starts, the correct count is ;
- when loading a text file, the function counts by one less.
// obj_jlabLineCount - метка в которой все вывожу
// obj_jtaMAIN - компонент JTextArea
obj_jlabLineCount.setText("Line(s): " + (obj_jtaMAIN.getLineCount()));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question