Cool project, especially if it manages to *stay* lightweight :) It is indeed difficult to build a console with Swing's text components. Actually, I think it's difficult with the out-of-the-box text components in just about any toolkit. They're not designed for it and there are a ton of edge cases and gotchas to take care of.
Anyway, a couple other random thoughts: * You might want to take a look at JSyntaxPane (https://code.google.com/p/jsyntaxpane/) for the editor. In theory adding Clojure syntax highlighting should be straightforward and they already cover stuff like line numbers, etc. * Consider using actions for your menu items so you can reuse them in toolbars and elsewhere in the UI * getCaretPosition (and almost all Swing methods) is not thread-safe so calling it from an agent is asking for trouble :) Good luck! Dave On Tue, Jul 19, 2011 at 7:20 AM, Alessio Stalla <alessiosta...@gmail.com> wrote: > On 18 Lug, 18:40, Arthur Edelstein <arthuredelst...@gmail.com> wrote: >> Hi Tamreen, >> >> On Jul 18, 5:38 am, Tamreen Khan <histor...@gmail.com> wrote: >> >> > It's a little confusing to see what's normally the text for the prompt, >> > "user=>", be in the window that shows the result. Why can't both the prompt >> > and the results be shown in the same area? >> >> That is a good point. I wanted a multi-line editor for the REPL input, >> so I put the REPL input and output in separate panes. But I agree it >> would be nice to have the prompt in the REPL input pane. I'm adding >> this suggestion to the issues. Thanks for the feedback! > > FWIW, I solved a similar problem in the past with a GUI REPL for > another JVM-based Lisp (ABCL). Unfortunately Swing makes such a thing > harder than it should be, at least if you stick to the "right" way of > properly using the Document interface upon which JTextArea is based. > Perhaps you can leverage some of that work. That REPL is very minimal > and I took some shortcuts, but it could be a nice starting point, > especially wrt. the nasty concurrency issues imposed by how Document > works. It was tested on all the three major OSes. If you're > interested, you can find it here: > http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/java/swing/REPLConsole.java > > hth, > Alessio > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en