• Post Reply Bookmark Topic Watch Topic
  • New Topic

Console input menue unresponsive on recall  RSS feed

 
Marcus Rauchfuss
Ranch Hand
Posts: 51
1
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

as part of the O'Reilly School Java 3 course I am currently tackling homework for a small I/O-program with console input.

Right now, only the part when you enter "E" or "e" on the console is implemented and the issue I am trying to tackle is described in the comment starting at line 38:



and the other class which is referenced:



Any hint on how to solve this issue with the unresponsive input would be highly appreciated :-)

 
Carey Brown
Saloon Keeper
Posts: 3318
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see where you call EnterOnTheConsole(), which should begin with a lower case. Use ArrayList<String> and not Vector<String>.
 
Marcus Rauchfuss
Ranch Hand
Posts: 51
1
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uuups, sorry about this, here's the corrected version (I prefer working with vector, for some reason)

enterOnTheConsole() is inserted on line 105 :-)

 
Carey Brown
Saloon Keeper
Posts: 3318
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your call to enterOnTheConsole() is giving you grief. Comment out line 105. Also, your call to anInputString.charAt(0) will throw an exception if you press enter (ie a blank line). Put a loop around all the lines in your main() with a test for a 'Q' that will break out of the loop. Your scanner member variable is never used because you never create an instance of your StringFileWriter class.

Vector predates ArrayList but has not been deprecated because it serves a very narrow function, specifically multi-threaded access to the same list instance. Otherwise, use ArrayList.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!