Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: Java Swing text as a grid? Date: Tue, 22 Apr 2014 11:45:42 -0400 Organization: A noiseless patient Spider Lines: 15 Message-ID: References: <8c3ea48c-26d5-4ef8-869b-08f46023b953@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 22 Apr 2014 15:46:13 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="6b9e92482af47766954d85fb77d372f5"; logging-data="12236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4my85nvE0MAcl2l/bi4iGV2cIqL5LOgU=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 In-Reply-To: <8c3ea48c-26d5-4ef8-869b-08f46023b953@googlegroups.com> Cancel-Lock: sha1:x8o9VEByoVU2EB0M6XWqXRelymU= Xref: csiph.com comp.lang.java.programmer:28184 On 04/22/2014 10:50 AM, rupertlssmith@googlemail.com wrote: > Hi, > > I'd like a text UI component that lets me place monospaced text within it, using row/column addressing. The built-in text controls are constructed around a Document model, which models text as a single stream (by stream I mean linear buffer of text), with rendered row/column derived from placement of newlines, wrapping strategy, and lots of other things. > > The Document model lets you have multiple root 'elements', each of which is a single stream. I'm thinking I could extend and existing text control, perhaps JTextArea, to render one root element per row, and disable all line wrapping. It might make more sense than having to insert newlines into the text stream to control row position. > > Does anyone have any thoughts on how to create a simple text grid UI control with Swing? I suppose I should take a look at lanterna, which must be achieving something similar to what I want, when emulating a console under Swing. > javax.swing.text is a big, and to my mind, complex package. Sorry I can't offer concrete suggestions.