Java – importing Source code into Jlist

javaswing

Is it possible to importing a java source code into Jlst? Please tell me how, and ll appreciate an example if possible. Thanks

Best Answer

I'm not I understand what you're trying to do, but can't you load your source file into a collection line-by-line (using BufferedReader.readLine() around a FileReader), and then create the appropriate ListModel ?

I suspect a TextArea may be more appropriate for code, though.