Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #944

disabling word wrap in a

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Eric Smith" <eric.smith@THRWHITE.remove-dii-this>
Subject disabling word wrap in a
Message-ID <qhps8bghl0.fsf@ruckus.brouhaha.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 30
Date Wed, 27 Apr 2011 15:30:29 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918229 96.60.20.240 (Wed, 27 Apr 2011 10:30:29 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:30:29 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:944

Show key headers only | View raw


  To: comp.lang.java.gui
I've got a JTextPane in a JScrollPane, which I'm using to let a user
display/edit some assembly source code.  I definitely do not want word
wrap.  If I override getScrollableTracksViewportWidth() to return
false, I don't get the word wrap.

But what I do get is a grey background in the JScrollPane to the right
of the rightmost character of the actual document.  If the document
is empty, there's just a sliver of white background where the insertion
point is, and as I type in text, the white background expands to
accomodate the text.  It looks really ugly, and I haven't found a
way to fix it.

I tried setting the background color of both the JTextPane and the
JScrollPane to white, but that didn't result in any visible change.

I also tried an alternative approach to avoiding word wrap, using
a custom subclass of StyledEditorKit and overriding the view used
for paragraphs.  That did disable word wrap, but had the same problem
with leaving part of the background grey.

Has anyone run into this before and solved it?

Thanks!
Eric

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

disabling word wrap in a "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
  Re: disabling word wrap i "IchBin" <ichbin@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000
    Re: disabling word wrap i "Rogan Dawes" <rogan.dawes@THRWHITE.remove-dii-this> - 2011-04-27 15:30 +0000

csiph-web