JTextPane and the direction of "textflow"

Hi, I got a kinda strange question.
What i want to do is to make the text in a JtextPane go from bottom and move up. The textpane wont be editable for the user.
That is: The text should show up at the bottom of the view and move up in the view as more text is added.
I could solve this somewhat unintelligent by adding an invisible box (Box.createVerticalStrut ) at the beginning of the text. The height would be the same as the viewport the textpane is inside. But are there more elegant solution? Scrollbars would be added as soon as the first line is entered into the textpane, and thats a less than ideal solution.

A little more background...
I traced a paste event all the way through, and I'm getting the fatal error at line 231 in HTMLEditorKit:
    public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException {
     if (doc instanceof HTMLDocument) {
         HTMLDocument hdoc = (HTMLDocument) doc;
         Parser p = getParser();
         if (p == null) {
          throw new IOException("Can't load parser");
         if (pos > doc.getLength()) {
          throw new BadLocationException("Invalid location", pos);
         ParserCallback receiver = hdoc.getReader(pos);
         Boolean ignoreCharset = (Boolean)doc.getProperty("IgnoreCharsetDirective");
         p.parse(in, receiver, (ignoreCharset == null) ? false : ignoreCharset.booleanValue());
         receiver.flush();
     } else {
         super.read(in, doc, pos);
    }Line 231 is the receiver.flush() call, at which point a RuntimeException is thrown and caught at line 212 in the EventDispatchThread class pumpOneEventForHierarchy method.
C'mon guys - this has got to be a bug! I traced while pasting some text from Notepad and that went fine. Then I pasted from Mozilla, and got the above. I can't see the state of the objects in the core Java classes (can't seem to get JBuilder to show that), but that's what's happening.
I'm going to hit post on this now, and then stop runtime debugging on JBuilder and watch my computer reboot. Can anyone shed some light on this???

Similar Messages

  • HT5271 Where on my mac do I find library?  I am trying to fix a blocked plug in and the directions to do so say I need to go to the /library/internet plug ins (disabled) folder.  no where to be found??

    Where on my mac do I find library?  I am trying to fix a blocked plug in and the directions to do so say I need to go to the /library/internet plug ins (disabled) folder.  no where to be found??

    Thank you, found it!  However, my real issue is a blocked plug in.  Another person was having the same issue and they where told to do this:
    Additional Information
    If you need to re-enable an out-of-date version of Flash Player, you can do the following:
    Navigate to the /Library/Internet Plug-Ins (Disabled) folder.
    Drag "Flash Player.plugin" into /Library/Internet Plug-Ins.
    If the browser is running, quit and restart it.
    Which I do not have a Internet Plug-Ins (disabled) folder?  Can I just drag the Flash Player Plug In to the trash and start over?  Help!!

  • JTextPane and the default PasteAction

    Now here's a really bad problem. I'm writing a custom word processor in Java (isn't everyone?). I'm using a JTextPane, with an assigned HTMLEditorKit and an assigned HTMLDocument. Code as shown below:
        this.vHtmlPane = new JTextPane();
        this.vHtmlKit = new HTMLEditorKit();
        this.vHtmlPane.setLayout(new BorderLayout());
        this.vHtmlPane.setEditorKit(this.vHtmlKit);
        this.vHtmlDoc = new HTMLDocument();
        this.vHtmlPane.setDocument(this.vHtmlDoc);
        this.vHtmlDoc.addUndoableEditListener(this.vUndoMgr);So far so good. Now, following all the documentation I could find, setting up cut and paste is as easy as the following:
        JMenu mEdit = new JMenu("Edit");
        mEdit.add(this.getActionByName(this.vHtmlKit.cutAction));
        mEdit.add(this.getActionByName(this.vHtmlKit.copyAction));
        mEdit.add(this.getActionByName(this.vHtmlKit.pasteAction));Where getActionByName() is implemented from:
      private void createActionTable(HTMLEditorKit htmlKit) {
        this.vActionMap = new HashMap();
        Action[] actions = htmlKit.getActions();
        for(int i = 0; i<actions.length; i++) {
          Action a = actions;
    this.vActionMap.put(a.getValue(Action.NAME),a);
    private Action getActionByName(String name) {
    return (Action)(this.vActionMap.get(name));
    The problem is when I go to paste something using ctrl-v (I'm developing on WinXP). I get an IllegalArgumentException followed by a whole lot of nullpointers and then everything goes to hell. My work machine just hangs, and my home machine reboots. The circumstances are like so:
    ctrl-c from Textpad or Notetabpro or any true text editor - works fine.
    ctrl-c from Mozilla or anything that adds anything remotely like html code to the clipboard - hell in a handbasket.
    I've traced the problem through several levels of the core JDK, and it seems that all the screaming starts in the TransferHandler classes importData(JComponent comp, Transferable t) method. Something about that and the interaction with the HTMLDocument trying to handle the import of html tags. Beyond that I'm kinda stumped. I would have thought that the default behaviour for an HTMLDocument paste would be to url-encode incoming text, but it seems that it pastes it wholesale, at which point the HTMLDocument refreshes and chokes on the tags it did not generate.
    I would appreciate any insight into how to override the default paste action or even better, how to fix it so the default paste action stops blowing up the app. I'd write my own default paste action without bothering the luminaries on this board, but after diving several levels into the EditorKit and finding such things as Flavor and Transferable classes and a PasteAction married to the EditorKit class... it just seemed like I must be missing the trick somehow.
    The particulars:
    Jdk: Sun 1.4.2_04
    IDE: JBuilder X patch 3
    WinXP sans the e-vile SP2 (so I'm on SP1)
    Anyone have any ideas?

    A little more background...
    I traced a paste event all the way through, and I'm getting the fatal error at line 231 in HTMLEditorKit:
        public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException {
         if (doc instanceof HTMLDocument) {
             HTMLDocument hdoc = (HTMLDocument) doc;
             Parser p = getParser();
             if (p == null) {
              throw new IOException("Can't load parser");
             if (pos > doc.getLength()) {
              throw new BadLocationException("Invalid location", pos);
             ParserCallback receiver = hdoc.getReader(pos);
             Boolean ignoreCharset = (Boolean)doc.getProperty("IgnoreCharsetDirective");
             p.parse(in, receiver, (ignoreCharset == null) ? false : ignoreCharset.booleanValue());
             receiver.flush();
         } else {
             super.read(in, doc, pos);
        }Line 231 is the receiver.flush() call, at which point a RuntimeException is thrown and caught at line 212 in the EventDispatchThread class pumpOneEventForHierarchy method.
    C'mon guys - this has got to be a bug! I traced while pasting some text from Notepad and that went fine. Then I pasted from Mozilla, and got the above. I can't see the state of the objects in the core Java classes (can't seem to get JBuilder to show that), but that's what's happening.
    I'm going to hit post on this now, and then stop runtime debugging on JBuilder and watch my computer reboot. Can anyone shed some light on this???

  • I'm trying to move pictures from my PC to IPad and the directions say to click the ipad name which is on the left but mine appears on the right. Is this important?  I'm having trouble getting clear directions on how to move photos to ipad.

    When I'm trying to sync photos from PC to Ipad the directions say to Launch I tunes  and an icon will appear on the left side. Mine appears on the right side. In general the directions for moving photos to Ipad from computer are vague.  Shoud I make a special folder on my PC for the pictures I want to move before I even start? How do I keep from losing pictures I synced the last time?

    If you have iTunes 11 then you can enable the left-hand side bar via control-S on a PC. You should then be able to connect and select the iPad on that left-hand sidebar, and then use the Photos tab on the right-hand side to sync your photos to it.
    Synced photos can't be deleted directly on the iPad, instead they are deleted by not including them in the next photo sync - so if you want the currently synced photos to remain on the iPad then you will need to include their folders in the next sync. I created a separate folder on my computer with sub-folders underneath it with the photos that I want on the iPad - I can select that folder on the Photos tab in iTunes, and the sub-folders then get their own albums on the iPad (if you have folders underneath those sub-folders then their photos will be included in the sub-folder's album i.e. you can't have albums within albums).

  • How to create a vi with 5 led light up in a series motion and the direction can be change with one button ?

    hello, i am new in labview and was given a task to create a vi like the stated above.. can anyone help me..??

    mingquanteo wrote:
    i hve my stop button inside the loop. but the program still will run even though i press the stop button. anything i did wrong.??
    The stop button will only get read every 10 seconds because the code is trapped inside a long sequence structure. Most likely, the button gets read right at the beginning of each itereation, meaning that it can take up to 20 seconds for the program to actually stop.
    Why did you change the mechanical action of the stop button.
    You also have a very basic misunderstanding of local variables. It makes no sense to read a terminal and wire it to a local variable ot itself.
    LabVIEW Champion . Do more with less code and in less time .

  • HT4623 I. Want to update iPad 1 to ios5 and the directions say to go to Settings then general, then to settings opiate...BUT SETTINGS Update does to appear in GENERAL Settins

    On iad1 I want to upgrade to IOS 5. I have read I need to go to SETTINGS, then GENERAL which I an do but there is no choice to UPGRADE SOFTWARE . What do I do...help please. Ty.

    Go back to the article you asked this question from, ignore the instructions for updating it wirelessly, scroll down, and follow those for updating it from iTunes on a computer.
    (84595)

  • Obnoxious JTextPane and JScrollPane problem.

    I have written a Tailing program. All works great except for one really annoying issue with my JScollPane. I will do my best to explain the problem:
    The program will continue tailing a file and adding the text to the JTextPane. When a user scrolls up on the JScrollPane, the program still adds the text to the bottom of the JTextPane and the user can continue to view what they need.
    Here is the problem: I have text being colored throughout the text pane. For instance, the word ERROR will be in red. The problem is when the program colors the text, it moves the scroll pane to the line where word that was colored is at. I don't want that. If the user moves the scroll bar, I want the scroll bar to always stay there. I don't want the program to move to the text that was just colored.
    Is there a way to turn that off? I can't find anything like that anywhere.

    Coloring text will not cause the scrollpane to scroll.
    You must be playing with the caret position or something.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • HT1212 my niece can't remember her passcode, i've followed the directions on here, but it didn't work..  What else can i do?

    Does anyone know how else my niece can get into her iPod, she forgot the pw and the directions online didn't help at all??

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
      Downloading past purchases from the App Store, iBookstore, and iTunes Store
    If problems, what exactly happens or does not happen and where in the instructions.

  • Difference in the Demand and the Released Demand to SNP for the month M0

    Hi evryone,
    I have released the demand from DP to SNP of a market on 03.02.2010 .
    Demand of M0 there is difference between the Forecast of the user and the demand released to the SNP.
    For rest of the months the demand Forecasted by the user and the demand released to the SNP is matching.
    I hope this difference is because I had released the demand on 03.02.2010, so the demand of the 01.02.2010 & 02.02.2010
    was not released to SNP. This is my guess only.
    Please tell me whether I am correct or not ?
    If I am wrong, please tell me the reasons for the difference in the month M0.
    with regards,
    balu

    Hi Balu ,
    If your forecast is released on 03022010 and you have a setting for period split as 2, then your understanding is correct .
    The M0 demand /forecast volume will be reduced by the qty of deliveries you made on 01 & 02022010 due to the requirement stateliest and forecast consumption process which is a std functionality.
    So please check if diff in original demand and released demand is same as of invoiced qty .. this will ensure your understanding.
    Also other factor that could affect the SNP released demand qty is 'Backward/Forward consumption period' in material master/product master.This is the period for forecast consumption and the direction depends on the defined consumption mode-
    so in future you could have a scenario that you have maintained forward consumption as ex. 60 days and there is no forecast in M0 but have some excess deliveries on 01M02010 and then the next months forecast will be consumed by that excess qty of delivery in M0 2010 and you would get diff volume in M12010 month.
    Hope this clears the doubt...
    Regards,
    Digambar

  • HT4623 I have followed the directions and my iphone is not installing the iOS 7.0.2.  My iphone is plugged into my lap top that has the most recent version of itunes.  It is a dsl connection.  Is that my problem?

    I have followed the directions and my iphone is not installing the iOS 7.0.2.  I have the most recent version of itunes on my laptop commuter.  my iphone is attached to my laptop via usb port.  The laptop uses dsl not wifi.  Is that my problem?

    Exactly what version of iTunes are you running? And DON'T say 'the latest version'... CHECK the version number. You need to be running 11.1 or higher.

  • I am using the Adobe Acrobat Reader on a mac and I followed all the directions to copy an image but when I press paste only half of the image appears or it appears as an empty square. What can I do to fix this?

    I am using the Adobe Acrobat Reader on a mac and I followed all the directions to copy an image but when I press paste only half of the image appears or it appears as an empty square. What can I do to fix this?

    Hello,
    I would like to inform you that not all the browsers and online PDF readers support copying text from a PDF. If you have opened the PDF online, please download PDF file to your computer and then open the file in Adobe Reader.
    Please share a screenshot if the issue still persists.
    Regards,
    Nakul

  • HT1657 I rented a movie and the sound doesn't work, how do I fix it?, who do I direct to for a complaint?

    Hi, I rented warhorse HD, and the sound doesn't work, my itunes version is 10.6.1(7). How do I fix it or who do I direct to get my money back? Thank you

    I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the entry, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • HT4527 I am trying to move my library and playlists to a new computer by burning to CD's. However, I followed the directions by going to File and then Library - then they said to go to burn CD(s) - I DO NOT have that option for some reason. How do I do th

    I am trying to move my library and playlists to a new computer by burning to CD's. However, I followed the directions by going to File and then Library - then they said to go to burn CD(s) - I DO NOT have that option for some reason. How do I do this? I have done the library sharing thing but I am getting rid of my primary computer and am afraid I will lose the library.

    To move an iPhoto Library to a new machine:
    Link the two Macs together: there are several ways to do this: Wireless Network,Firewire Target Disk Mode, Ethernet, or even just copy the Library to an external HD and then on to the new machine...
    But however you do choose to link the two machines...
    Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
    Then hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    and select the Library that you moved.  That's it.
    This moves photos, events, albums, books, keywords, slideshows and everything else.
    Your first option didn't work because you imported one Library to another. Every version and thumbnail is imported like a distinct photo, you lose all your Albums, Keywords etc., the link between Original and Previews is destroyed, the non-destructive editing feature is ruined and so on. In summary: it's mess.
    Your second option didn't work because you simply referenced her library on the old machine.
    Regards
    TD

  • HT204088 The directions you provided above doesnt even work!  when I selected "Click to open your account", there is an ERROR message and takes me to no where!  when I try to access my itunes account, it says I have no history?

    The directions you provided above doesnt even work!  when I selected "Click to open your account", there is an ERROR message and takes me to no where!  when I try to access my itunes account, it says I have no history?

    You are not able to view purchase history on your iOS device.  You may only re-download previous purchases from the iOS device.
    To review your iTunes Store account's purchase history, follow the steps in this article from a computer only:
    Seeing your iTunes Store purchase history and order numbers
    http://support.apple.com/kb/HT2727

  • What is the direct link between Schedule Line item and Delivery line item?

    Hi SAP SD Gurus,
    The question is simple.  I would like to calculate the Open order quantity for a particular month based on the Schedule Line Date.
    I am taking all the Schedule lines falling below the running date of the month and sum up that and look for the deliveries happened for that Schedule lines.
    I am unable to link that Schedule line with that Delivery line item.
    The only link is Schedule Line Number in VBEP table which is not available in LIPS.  I would like sum up the Schdule line Quantities and Subtract the sum of the Delivery quantities which will give me the Open orders for the particular day of the month.
    Can anyone help me to link this VBEP table to LIPS table to connect the Schedule line number with the Delivery line item?
    Thanks in advance for your help..
    Augustine

    Anuj,
    I am aware of the Functional Modules. 
    I wanted to know for this Schedule Line, this is Delivery document created.
    Where in SAP through Tables it is linked?  Because, I need to source the Tables to calulate the open orders by way of external report through Business Object.
    The table link from VBEP to LIPS is not directly linked.  It is linked from Sales order line item level.  Because we are capturing all the Sales order Line tiems through the Delivery Status which is not equalled to C. But if there are partial deliveries against the Scheuld Line item level, we need to identify.  The only common joint should be Scheldule line number which is not available in LIPS.
    If we are developing report inside SAP, we can use the said Functional Modules to capture through Structures VBEPD.  Since it is a external reporting , we need to give correct tables and the joints.  Hence I am looking for any other way to solve this.
    Thanks
    Augustine Ponraj

Maybe you are looking for

  • Nothing on firefox is working

    After updating my Firefox I have encountered a several problems. 1. When right clicking on the tab bar, and then clicking undo closed tab. Nothing happens. Firefox will also say I have no new closed tabs. 2. Firefox will also say that even tho a page

  • Iphone 4 from Korea Country Locked?

    Is it possible that my iphone 4 from korea is country locked?? I can use KT and SK Telecom micro simcard.. but it can't accept micro sim from my country? how can i solve this problem? Please help me.

  • Contact Sheet plug-in - it's in the folder, but not the menu

    Hello, I'm running PS CS55.1 on Windows 7. I thought I was running in 64bit mode, but when PS starts up, it says Versiion 12.1 x32. I downloaded the plug in, but it's not showing up. In my C folder, there's Program Files >... >Adobe Photoshop CS5.1 (

  • Displaying buttons and other items in french instead of english

    Hi, I am new to APEX., which I find incredibly easy to use. Anyway, I am french (nobody is perfect!) and I would like the texts inside the buttons (like 'Create', 'Reset') and in the other part of the aplication ('Edit') to appear in french. BUT with

  • Beginner question: support to HTTP POST om Oracle AS

    Hi! I don't know if this is a suitable forum but since i use JDeveloper and Oracle BPEL I'll try my luck here :). I have a Java web application built in JDeveloper and a couple of BPEL processes. In these processes I use Java embedding (a piece of Ja