tags:

views:

75

answers:

3

Hello,

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

A: 

I don't know what you mean. Maybe more info about your problem...

Martijn Courteaux
+1  A: 

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.

Brian Agnew
+1  A: 

I don't think you want to import it into JList. Text is better presented in JTextArea or JEditorPane. Here is where you can read more about it http://java.sun.com/docs/books/tutorial/uiswing/components/textarea.html http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html

eugener