Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2005

Tip: Looking for answers? Try searching our database.

Word Wrap in JTextPane - keeping it from happening

Thread view: 
Dale Pennington - 20 Apr 2005 15:02 GMT
I have a JTextPane in a JScrollPane

m_textPane = new JTextPane();
m_textScroll = new JScrollPane(m_textPane);
m_textPane.setEditable(false);

Right now, the JTextPane, wraps lines rather than causeing a horizontal
scroll bar to appear. A vertical scroll bar does appear when the JTextPane
gets enought text.

I may be missing something obvious, but is there a way to tell the JTextPane
to NOT wrap text. I have checked the JTextPane API, the base class APIs,
StyleConstants and StyledDocument just in case.

Thanks,
Dale Pennington

#! rnews 1359
Xref: xyzzy comp.windows.x.motif:17777
Newsgroups: comp.windows.x.motif
Path: xyzzy!nntp
From: "Fred L. Kleinschmidt" <fred.l.kleinschmidt@nospam_boeing.com>
Subject: Re: XmTextField key bindings
X-Nntp-Posting-Host: xpc-ps-61.nw.nos.boeing.com
Content-Type: text/plain; charset=us-ascii
To: zen13097@zen.co.uk
Message-ID: <426662C0.99C10F31@nospam_boeing.com>
Sender: nntp@news.boeing.com (Boeing NNTP News Access)
Content-Transfer-Encoding: 7bit
Organization: Boeing
X-Accept-Language: en
References: <4266574c$0$2588$da0feed9@news.zen.co.uk>
Mime-Version: 1.0
Date: Wed, 20 Apr 2005 14:10:08 GMT
X-Mailer: Mozilla 4.79 [en]C-CCK-MCD Boeing Kit  (Windows NT 5.0; U)

It's easier to override translations for <Key>Delete and <Key>Backspace.

Dave Weaver wrote:

> I'd like to change the keybindings of an XmTextField widget
> programatically.
>
> I am trying to implement some basic right-to-left text entry, and
> would like to add a button to toggle the input direction of the
> widget.
>
> When in RtoL mode, I want to swap the key bindings of DELETE and
> BACKSPACE.
>
> I know I can change key  bindings in the resource
> file, but that is unsufficient for my problem. How do I do it from
> within my C++ code?

Signature

Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94  (206)544-5225

Fred L. Kleinschmidt - 20 Apr 2005 15:27 GMT
> I have a JTextPane in a JScrollPane
>
[quoted text clipped - 12 lines]
> Thanks,
> Dale Pennington

use a JTextArea
Signature

Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94  (206)544-5225



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.