Where in the JTextArea code is line/word wrapping handled?

Hi all--
I was making a custom renderer using a JTextArea, and was looking in the source code for JTextArea trying to figure out how it determines when to break a line given it's width and the current font...but I can't find it anywhere. I can find this function:
public void setLineWrap(boolean wrap) {
        boolean old = this.wrap;
        this.wrap = wrap;
        firePropertyChange("lineWrap", old, wrap);
    }but it appears to simply set a private boolean called "wrap" that isn't in its superclass JTextComponent. So one can only imagine that it must somehow calculate where to wrap its text. But this code is no where to be found in JTextArea. In fact, the only thing I can find is that it fires this "lineWrap" property change, but I cannot find in either JTextArea or JTextComponent where this event is handled to recalculate where to draw the string and when to wrap it to a new line.
Mostly I'm just curious how it's done more than anything else. Anyone know where the missing code is to handle this?

Yeah, this stuff gets pretty twisted. The main entry point is the getViewFactory() method in the RootView member class of BasicTextUI. (RootView is just what it sounds like: the root of whatever View hierarchy finally gets built.) It first tries to get a ViewFactory from the EditorKit, and if that doesn't work, it returns the enclosing BasicTextUI object. If the component being constructed is a JTextPane or JEditorPane, the EditorKit will be a StyledEditorKit or a subclass thereof, which will provide a ViewFactory that can vary with the kind of document being displayed/edited. But in the case of JTextArea, it will be a DefaultEditorKit, which returns null from its getViewFactory() method, meaning the BasicTextUI object is expected to serve as the ViewFactory. BasicTextUI provides only a dummy implementation of the ViewFactory interface, but its subclass, BasicTextAreaUI, implements create(Element) to return either a PlainView or a WrappedPlainView, depending on the relevant setting the the JTextArea.

Similar Messages

  • Enter the Section code for line number '000'

    Dear Consultants,
    While posting the Travel Expenses, The system generates posting documents but gives error as "Enter the Section code for line number '000'". Please advise me about the activity to which this error is related to. I am giving Document type as AB.
    This error is seen only if the Expense Type is related to some Vendor account like Expenses by company (Service provider's vendor a/c) or Advances paid to the employee & Expenses incurred by employee (Employee Vendor account)
    Regards,
    Bindumadhav
    Edited by: BINDUMADHAV AMBIKE on Mar 26, 2011 7:18 PM

    I found that some validation criteria were maintained in Tcode OB28. We can edit those validation criteria to exclude Travel Management. OR it was suggested by FICO to use posting key as 34 instead of 31.
    This solved my problem.

  • Where is the source code of custom UI page is written.

    hi experts,
    I am currently working on CRM 6.0
    we have the standard UI page in SAP ,on which we  have added our enhancements.Now I need to know where is the html code for the standard page is written,since I need to add a meta tag in that code.I know that the UI is divided in frames.When I rightclick on  view souce in the IE I can see a java script code,but not sure from where its originating....
    please let me know in which component the code is written or if there is some other location.
    Edited by: Anu_87 on Jul 6, 2010 7:56 PM
    Edited by: Anu_87 on Jul 6, 2010 7:57 PM

    Hi,
    If you are aware of BSP_WD_CMPWB transaction then you may be able to notice the  'View Layout' section towards the bottom of the 'View Structure' tab. In the section if you double click on the htm page it will take you to the htm page layout. The htm page has the same name as the view.
    Regards
    Prasenjit

  • Where is the source code of custom UI page written

    hi experts,
    I am currently working on CRM 6.0
    we have the standard UI page in SAP ,on which we  have added our enhancements.Now I need to know where is the html code for the standard page is written,since I need to add a meta tag in that code.I know that the UI is divided in frames.When I rightclick on  view souce in the IE I can see a java script code,but not sure from where its originating....
    please let me know in which component the code is written or if there is some other location.
    Edited by: Anu_87 on Jul 6, 2010 7:54 PM

    hello,
    Please try by rigght click and properties...you will get an applaictaion and page name...
    Thanks.

  • Where does the source code of linux reside in arch

    Just wonder where is the source code. In freebsd, all the source code is in /usr/src, does arch have that directory? or do I need to install something to get source code?

    tomk wrote:Arch does not install the source code for anything. Under /usr/src/linux-2.6.17-ARCH, you will find the kernel headers required for building other apps, but apart from that, if you want the source code for the kernel or any of the apps, you need to get it from the relevant website/ftp server/etc e.g. kernel.org for kernel source.
    no, those headers in there are for kernel modules only. the headers for applications are a sanitised copy based on 2.6.12 and exist in /usr/include/linux.
    As for the source to Arch packages, we have something similar to fbsd's ports system (ports is on fbsd isnt it or am I wrong), it's called abs:
    http://wiki.archlinux.org/index.php/ABS#The_ABS_tree

  • Where is the redemption code located on elements 13? The numbers and letters i entered come up invalid

    Where is the redemption code located on product elements 13. There are numbers and characters on the box and on the cd sleeve.

    Or even in a prepaid card as per this picture:
    Click on the image and get the necessary instructions how to redeem it to get proper serial number.

  • THIS IS DRIVING ME CRAZY - WHERE IS THE PRINTER CODE

    I cant find the printer code????
    I cant set up eprint  ((
    Help - where is the printer code!!!!

    Which printer do you have? Were you able to enable web services on your printer? The reason I asked is because once Web Services is activated, ePrint for your printer also gets activated. When ePrint gets activated it will assign an email address to your printer. The printer code is actually the email address minus "@hpeprint.com".
    Let me know if it works.
    Binary_Zen (worked at HP )
    Click the white Kudos star to say thanks
    Please mark Accept As Solution if it solves your problem

  • Where is the HTML-Code for the Dashboard-Links defined? How to edit it?

    Hello everyone,
    I'd like to know where HTML-Code for the Dashboard-Links (My Dashboard, insert random Dashboardname here, ...) is defined.
    Inspecting HTML-Code via the browser, i'll got the following HTML-Tag:
    an <a'' href="...url"... class="CurrentPortal" name="DashboardBannerLink" title="...">Dashboard-name</a''>
    What i know is, that i can modify portalbanner.css and edit the style of those links.
    But thats not what i want, though. I want to modify the html-code itself, for example change the layout of the table etc, to meet our company's corporate design requirements.
    Thats why i tried to find the terms PortalLink and CurrentPortal within the Message-Database (/msgdb).
    Unfortunately, i got no results.
    As a consequence, I believe HTML for those Links is generated by saw.dll internally and therefore can not be edited.
    Now i need someone to prove me wrong ;)
    Thanks in advance,
    Chris
    Edited by: Chris2010 on 16.08.2010 11:11
    -had to edit the html tag, as the code was turned into a clickable link when i posted the thread

    I still didn't find a solution until now, although i checked almost every xml file, that i was able to find.
    At the moment I am sure, that it would be necessary to edit sawm-Parameter "bannerHtml" to meet my requirements. Now, i dont know whether its possible to edit it or not, since those saw-parameters do not seem to be documented on the web.
    That's the part, i found in dashboardtemplates.xml (Line: 362)
    <WebMessage name="kuiDashboardBanner" translate="no"><!-- Param bannerHtml --><!-- Param dashboardsURL -->
    <HTML>
    <table class="PortalBanner" width="100%" border="0" cellspacing="0">
    <tr>
    <td class="PortalLogo">
    "<\a href="@{dashboardsURL}">
    <img class="PortalLogoImage" border="0" src="fmap:Portal/PortalLogo.gif"/></a>
    "</td>
    <td class="PortalTop" style="vertical-align:top">
    <sawm:param name="bannerHtml"/></td>
    </tr></table>
    <sawm:messageRef name="kuiDashboardMainBar"><sawm:setParam name="product">dashboard</sawm:setParam></sawm:messageRef>
    </HTML></WebMessage>
    -----

  • Where all the ok codes will be saved

    hi
         in which table all the okcodes will be saved.
      and what is the text table where we can find the long text data for va01 and other transaction. in which table all this test table will get stored.
    regards
    sri

    Hi,
    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and pfstatus.
    ok_code is generally used in screen as of I have used. You will define the function in the screen and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    I hope it gives you the difference between the two.
    Reward if usefull..
    Regards,
    Srini

  • Where is the Source code in Java 6 EE?

    This is my first time downloading the EE version (instead of the SDK).
    I cant find the source code.
    it installed to: C:\Sun\SDK
    and i did a search for "src" and "source" and didnt find anything.
    if its not included, where can i download the java source?

    Wow. That was overkill.
    It went from 40 MB to 240.
    Whats with the strange install process too?

  • Where Can the Sample Code for That Balloon Game Demoed on WWDC for Swift Be Downloaded

    Hi. I can't find the balloon game sample code used in the WWDC in the Sample Code for iOS or OS X (assuming it's available for download). If it is available for download by Apple, where can it be downloaded?
    Thank you in advance.
    God bless, Cor. 13

    The assets are in the .playground file's file package. Select the .playground file in the Finder, right-click, and choose Show Package Contents to browse the file package. The graphics files are in the Resources folder inside the file package.

  • Where Is The Edge Code Compiler?

    I was just wondering where the Java Compiler is supposed to be accessed in the Edge Code application? I have a fairly long Java source code program which pretty badly needs compilation as soon as possible.

    There is no Java compiler component for Edge Code. Edge Code is designed for JavaScript (not Java) developers.
    Randy

  • Where is the 'hiden' code?

    Hello!
    I need to controll all events in JComboBox class. I've been looking into src code of Java 1.4 to find where is the code which makes popup window of JComboBox dissapear when you click over another GUI component (not over the same JComboBox) but I was not able to find it. Does anyone know where it is?

    i don't know about making it "disappear", for that I think you'd have to redo your gui itself and take out the component.
    however, there is the function java.awt.Component.setEnable(false) which will disable the box.
    hope that helps!

  • Where is the error code ring constant in LV8 ???

    Hi
    the question seems rather stupid to me but I can't find the error code ring constant any more in LV8.
    Where does it hide?
    Gruß,
    Sören

    You can copy it from some VI made in previous version of LV. It works fine.
    jochynator
    LV 8.0.1, WinXP Pro
    Attachments:
    error_ring_example.vi ‏11 KB

  • Where's the source code for the JavaFX 8 Samples?

    Hi,
    I just downloaded the samples for JavaFX 8 and the menu popup on the top left really caught my attention.
    I'd like to study the source code for it. Does anyone know where I can find it?
    I expected it here http://hg.openjdk.java.net/openjfx/8/master/rt/file but it seems it's not there.
    Alternatively: Jasper Potts presented a Kiosk App at Devoxx 2012 (Antwerp), which was also used at JavaOne. I think this app uses the same Menu. And he said sources are available. But I can't remember the link.

    Oh, too obvious. They are directly included into the zip. My bad I didn't notice them. I had expected them to be online somewhere. Thanks!

Maybe you are looking for

  • Mac mini start up

    Hello, this is my first time on here in years. I recently purchased mac min 1.42ghz. With the computer I received a wireless keyboard and mouse along with it. For the last three days I try to turn it on, and it seems like it stays on a blue screen fo

  • [Solved] Insync package error holding up system upgrade

    I'm getting the following problem when trying pacman -Syu error: insync: missing required signature I think I installed insync from aur - so I'm not sure how it's trying to update during the pacman -Syu process (or do all aur packages do this?). Also

  • Software caused connection abort?

    I am receiving the following errors: Nov 20 08:13:07 nexus sendmail[29376]: [ID 801593 mail.crit] NOQUEUE: SYSERR(root): getrequests: accept: Software caused connection abort I have not been able to find anything regarding the cause or resolution of

  • Maintain number range object for object J_1IINTNUM

    Dear, While doing GRN i am getting this error: Maintain number range object for object J_1IINTNUM, year 2009, excise group Maintain number range object for object J_1IRG23A1, year 2009, excise  group E1 Maintain number range object for object J_1IRG2

  • Constant BSOD, Can't seem to fix

    My board crashed so I replaced it and my memory with an MSI 970A-G46.  My RAM is running in dual channel with 8GB on each side.  I reinstalled Win 64 bit and it started crashing almost immediately.  It would run for a few hours but then crash.  It on