Java search in text file with joptionpane? -


im new java. im quite lost here, im working on project should search in text file corresponding word, line line. got little someone, thereĀ“s errors gui in joptionpane.

this have until now. gui:

private void jmenuitemlookupactionperformed(java.awt.event.actionevent evt) {                                                     joptionpane.showoptiondialog(null, "title", "message",      joptionpane.default_option, joptionpane.plain_message,     null, options.toarray(new string[] {}), options.get(0)); } 

and code search.

public string lookup(string question){     list<string> options = new arraylist<>();     (object value : data.values()) {     if (value.tostring().startswith(question)) {         options.add((string) value);     } } 

move list<string> options = new arraylist<>(); outside lookup method , make class variable. compiler cannot find options object.


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -

c# - MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3243,9): error MSB4094 -