Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

count lines and jButton.doClick  RSS feed

 
Tai Yo
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this problem has a simple solution, but I couldn't solve it.
For example, I am counting lines of text file.
Also jPanel have jTextField1, jButton. jButton adds dynamic jTextFields.
Now I am loading contents of text file to jTextFields.
Text file:

And jButton.doClick() depends from line numbers.
For example in this code:

So jButton.doClick() adds 3 dynamic jTextFields, but as 1st line on text file is value of jTextField1, how can I decrement it for linenumber-1?
 
Tai Yo
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pardon I have solved my problem.
 
Campbell Ritchie
Marshal
Posts: 55678
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
…and what was the solution? I thought the line number reader provided line numbers and counts automatically.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!