JTextPane and RTF line returns

I'm wondering is there anyway to use a line return with JTextPane's? I'm not sure if thats what they're called but what i'm talking about is the RTF equivelent of <BR>. I tried importing a file with line returns and none of they were treated as a space. I also tried typing shift-enter like in word, but that didn't do anything. Is it possible to use line returns with a jtextpane? or is that just something you have to do without?

Okay here's my code:
     coursetext = new JTextPane();
     coursetext.setContentType("text/RTF");
     RTFEditorKit edkit = new RTFEditorKit();
     coursetext.setEditorKit(edkit);
and later on:
     RTFEditorKit edkit = new RTFEditorKit();
     File file = new File("gn.rtf");
     try {
          FileInputStream fr = new FileInputStream(file);     
          DefaultStyledDocument doc = new DefaultStyledDocument();
          edkit.read(fr,doc, 0);
          coursetext.setStyledDocument(doc);
The file i'm loading is saved as an RTF file from Wordpad. If i try to load a rtf file saved from MS Word (2003) it gives me a null pointer exception.

Similar Messages

  • File sender  - carriage return and new line as endseparator

    Hi All,
    I'm stumbled with a problem to set carriage return and newline character as the endseparator (record delimiter)
    Scenario: The input file PI is receiving has got few fields which has text in it and the content in this text has got newline characters. So to identify record separator, at  the end of each record the combination of carriage return and new line is added.
    In file sender content conversion I've set the folllowing parameters to achieve this:
    Row.fieldSeparator :   ,  (comma)
    Row.endSeparator  :  '0x0D''0x0A'
    Problem: In my sample input file, the first row has a text field with a newline character. When executed PI is splitting the record at the newline character in the text field (instead of combination of carriagereturn and newline which is set in the endSeparator paramter).
    Pls advice on how to resolve this .
    Happy Holidays!!
    amar

    Rajesh..Thanks for your quick response
    I'm trying with the actual file being provided by the trading partner. I did not generate the file nor changed the file..
    Before identifying the combination of carraige return and new line, the adapter is splitting the record when encountered with new line character within one of the text fields.
    As you said it worked for you, you do have new line characters within fields in a record?..pls throw some light..let me know for any information..
    Thank you
    amar--

  • JTextPane and Horizontal Scrollbars

    Hi there,
    I had written an app that included an Event Log, and all was good in my
    world.
    Then one of the app users commented they would like errors to stand out within the log!
    I said "No Problem" but it turns out to be a major bloody headache!!!!!
    I was using a JTextArea but after reading some posts on this forum I decided to use a JTextPane. I found some code for changing the font colour, and everything appeared to be working fine ;-)
    ...until that is I realised my HORIZONTAL_SCROLLBAR_AS_NEEDED was never needed as the text had started to wrap ;-(
    I have tried searching this site and none of the suggestions work for me, the vertical scroll works fine - and I am really stuck. Therefore:
    Is there a way to get the Horizontal scroll bar working in a JTextPane?
    Is there an alternative to JTextPane that will allow me to control font colour by line?
    Do you even know what I am harping on about?
    Or should I admit defeat and add a second JTextArea and a button to switch between my two event types??
    Any suggestions would be greatly received!
    P.S. Below is the edited code that I think is responsible for my problem :0)
    public class EventLogGUI extends JPanel
    private JPanel jpLog = new JPanel();
    private StyledDocument sdLog = new DefaultStyledDocument();
    private JTextPane jtpLog = new JTextPane( sdLog );
    private MutableAttributeSet mas = new SimpleAttributeSet();
    private JScrollPane jspLog;
              public EventLogGUI()
              this.setBounds( 5, 7, 407, 256 );
              this.setBorder( BorderFactory.createLoweredBevelBorder() );
              this.setLayout( null );
              this.add( jpLog );
              jspLog = new JScrollPane( jtpLog,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
              jspLog.setBounds( 12, 25, 372, 180 );
              jpLog.setLayout( null );
              jpLog.setBounds( 5, 5, 397, 218 );
              jpLog.add( jspLog );
              jtpLog.setEditable( false );
              jtpLog.setMargin( new Insets ( 2, 2, 2, 2 ) );
              public void initialiseGUI()
              Vector events = uploadEventLog();
              String event;
              jtpLog.setText( "" );
                        for ( int i = 0; i < events.size(); i++ )
                        event = "" + events.elementAt( i );
                                  if ( event.length() >= 8 && event.substring( 0, 8 ).equals( "WARNING:" ) )
                                            StyleConstants.setForeground( mas, Color.red );
                                  else
                                            StyleConstants.setForeground( mas, Color.black );
                                  try
                                  sdLog.insertString( sdLog.getLength(), event + "\n", mas );
                                  catch( Exception e )
    }

    Hi!
    just wondered if you've searched the forum already. If not: always do that before posting.
    I searched and found this helpful:
    http://forum&threadID=256602
    the solution found in that thread is to extend the JTextPane and add a setLineWrap-method:
    class JTextWrapPane extends JTextPane {
        boolean wrapState = true;
        JTextArea j = new JTextArea();
         * Constructor
        JTextWrapPane() {
            super();
        public JTextWrapPane(StyledDocument p_oSdLog) {
            super(p_oSdLog);
        public boolean getScrollableTracksViewportWidth() {
            return wrapState;
        public void setLineWrap(boolean wrap) {
            wrapState = wrap;
        public boolean getLineWrap(boolean wrap) {
            return wrapState;
    }  now you can use JTextWrapPane instead of JTextPane:
    //  instead of   private JTextPane jtpLog = new JTextPane( sdLog );
        private JTextWrapPane jtpLog = new JTextWrapPane( sdLog );and set JTextWrapPane.setLineWrap(false):
            jtpLog.setLineWrap(false);It may not be the non plus ultra, but it seamed to work for me. ;)

  • Incorrect Offset in setCharacterAttributes() of JTextPane AND Matcher

    I use Java regular expression, Matcher class or m.find(), for searching and replacing string from JTextPane. Then, I use setCharacterAttributes() to change color of the matched string.
    My problem is that when text in the JTextPane() contains new line characters, the start position returned from m.start() includes those new line characters but the setCharacterAttributes() method does not.
    Therefore, if I use the start position returned from m.start() as "offset" for the setCharacterAttributes() method, the matched string is incorrectly colored. If there are two new line characters before the matched string, the colored text will be missed by two characters to the right.
    For example, if the matched string is "are" in the "how are you?" text, and there are two new line characters before the text, the colored text is "e y" rather than "are".
    What should I do to fix this problem?
    Thank you very much.

    Get the position of the found text from the document associated with the JTextPane. Try this:import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.JTextPane;
    import javax.swing.SwingUtilities;
    import javax.swing.text.Document;
    public class SearchTextPane {
       JFrame frame = new JFrame ("Search JTextPane Test");
       JTextPane textPane = new JTextPane ();
       JPanel panel = new JPanel ();
       JTextField textField = new JTextField (10);
       JButton button = new JButton ("Find");
       Document doc = textPane.getDocument ();
       void makeUI () {
          button.addActionListener (new ActionListener () {
             public void actionPerformed (ActionEvent e) {
                try {
                   Matcher matcher = Pattern.compile (textField.getText ())
                         .matcher (doc.getText (0, doc.getLength ()));
                   matcher.find ();
                   textPane.setCaretPosition (matcher.start ());
                   textPane.moveCaretPosition (matcher.end ());
                   textPane.requestFocus ();
                } catch (Exception ex) {
                   JOptionPane.showMessageDialog (frame, "Not Found!\n" + ex.toString ());
                   //ex.printStackTrace();
          panel.add (textField);
          panel.add (button);
          panel.setPreferredSize (new Dimension (300, 40));
          frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
          frame.setSize (300, 300);
          frame.add (textPane, BorderLayout.CENTER);
          frame.add (panel, BorderLayout.SOUTH);
          frame.setLocationRelativeTo (null);
          frame.setVisible (true);
       public static void main (String[] args) {
          SwingUtilities.invokeLater (new Runnable () {
             public void run () {
                new SearchTextPane ().makeUI ();
    }db

  • JTextPane and highlighting

    Hello!
    Here's what I'm trying to do: I have a window that needs to display String data which is constantly being pumped in from a background thread. Each String that comes in represents either "sent" or "recieved" data. The customer wants to see sent and recieved data together, but needs a way to differentiate between them. Since the Strings are being concatinated together into a JTextPane, I need to highlight the background of each String with a color that represents whether it is "sent" (red) or "recieved" (blue) data. Should be easy right? Well, not really...
    Before I describe the problem I'm having, here is a small example of my highlighting code for reference:
         private DefaultStyledDocument doc = new DefaultStyledDocument();
         private JTextPane txtTest = new JTextPane(doc);
         private Random random = new Random();
         private void appendLong() throws BadLocationException {
              String str = "00 A9 10 20 20 50 10 39 69 FF F9 00 20 11 99 33 00 6E ";
              int start = doc.getLength();
              doc.insertString(doc.getLength(), str, null);
              int end = doc.getLength();
              txtTest.getHighlighter().addHighlight(start, end, new DefaultHighlighter.DefaultHighlightPainter(randomColor()));
         private Color randomColor() {
              int r = intRand(0, 255);
              int g = intRand(0, 255);
              int b = intRand(0, 255);
              return new Color(r, g, b);
         private int intRand(int low, int hi) {
              return random.nextInt(hi - low + 1) + low;
         }As you can see, what I'm trying to do is append a String to the JTextPane and highlight the new String with a random color (for testing). But this code doesn't work as expected. The first String works great, but every subsequent String I append seems to inherit the same highlight color as the first one. So with this code the entire document contents will be highlighted with the same color.
    I can fix this problem by changing the insert line to this:
    doc.insertString(doc.getLength()+1, str, null);With that change in place, every new String gets its own color and it all works great - except that now there's a newline character at the beginning of the document which creates a blank line at the top of the JTextPane and makes it look like I didn't process some of the incomming data.
    I've tried in veign to hack that newline character away. For example:
              if (doc.getLength() == 0) {
                   doc.insertString(doc.getLength(), str, null);
              } else {
                   doc.insertString(doc.getLength()+1, str, null);
              } But that causes the 2nd String to begin on a whole new line, instead of continuing on the first line like it should. All the subsequent appends work good though.
    I've also tried:
    txtTest.setText(txtTest.getText()+str);That makes all the text line up correctly, but then all the previous highlighting is lost. The only String that's ever highlighted is the last one.
    I'm getting close to submitting a bug report on this, but I should see if anyone here can help first. Any ideas are much appreciated!

    It may work but it is nowhere near the correct
    solution.It seems to me the "correct" solution would be for Sun to fix the issue, because it seems they are secretly inserting a newline character into my Document. Here's a compilable program that shows what I mean:
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.EventQueue;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.Random;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.DefaultHighlighter;
    import javax.swing.text.DefaultStyledDocument;
    public class TestFrame extends JFrame {
         private JButton btnAppend = new JButton("Append");
         private DefaultStyledDocument doc = new DefaultStyledDocument();
         private JTextPane txtPane = new JTextPane(doc);
         private Random random = new Random();
         public TestFrame() {
              setSize(640, 480);
              setLocationRelativeTo(null);
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        dispose();
              getContentPane().add(new JScrollPane(txtPane), BorderLayout.CENTER);
              getContentPane().add(btnAppend, BorderLayout.SOUTH);
              btnAppend.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        doBtnAppend();
         private void doBtnAppend() {
              try {
                   String str = "00 A9 10 20 20 50 10 39 69 FF F9 00 20 11 99 33 00 6E ";
                   int start = doc.getLength();
                    * This line causes all highlights to have the same color,
                    * but the text correctly starts on the first line.
                   doc.insertString(doc.getLength(), str, null);
                    * This line causes all highlights to have the correct
                    * (different) colors, but the text incorrectly starts
                    * on the 2nd line.
    //               doc.insertString(doc.getLength()+1, str, null);
                    * This if/else solution causes the 2nd appended text to
                    * incorrectly start on the 2nd line, instead of being
                    * concatinated with the existing text on the first line.
                    * (a newline character is somehow inserted after the first
                    * line)
    //               if (doc.getLength() == 0) {
    //                    doc.insertString(doc.getLength(), str, null);
    //               } else {
    //                    doc.insertString(doc.getLength()+1, str, null);
                   int end = doc.getLength();
                   txtPane.getHighlighter().addHighlight(start, end, new DefaultHighlighter.DefaultHighlightPainter(randomColor()));
              } catch (BadLocationException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        new TestFrame().setVisible(true);
         private Color randomColor() { return new Color(intRand(0, 255), intRand(0, 255), intRand(0, 255)); }
         private int intRand(int low, int high) { return random.nextInt(high - low + 1) + low; }
    }Try each of the document insert lines in the doBtnAppend method and watch what it does. (comment out the other 2 of course)
    It wastes resources and is inefficient. A lot of work
    goes on behind the scenes to create and populate a
    Document.I tracked the start and end times in a thread loop to benchmark it, and most of the time the difference is 0 ms. When the document gets to about 7000 characters I start seeing delays on the order of 60 ms, but I'm stripping off text from the beginning to limit the max size to 10000. It might be worse on slower computers, but without a "correct" and working solution it's the best I can come up with. =)

  • Problem with JTextPane and StateInvariantError

    Hi. I am having a problem with JTextPanes and changing only certain text to bold. I am writing a chat program and would like to allow users to make certain text in their entries bold. The best way I can think of to do this is to add <b> and </b> tags to the beginning and end of any text that is to be bold. When the other client receives the message, the program will take out all of the <b> and </b> tags and display any text between them as bold (or italic with <i> and </i>). I've searched the forums a lot and figured out several ways to make the text bold, and several ways to determine which text is bold before sending the text, but none that work together. Currently, I add the bold tags with this code: (note: messageDoc is a StyledDocument and messageText is a JTextPane)
    public String getMessageText() {
              String text = null;
              boolean bold = false, italic = false;
              for (int i = 0; i < messageDoc.getLength(); i++) {
                   messageText.setCaretPosition(i);
                   if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && !bold) {
                        bold = true;
                        if (text != null) {
                             text = text + "<b>";
                        else {
                             text = "<b>";
                   else if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        // Do nothing
                   else if (!StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        bold = false;
                        if (text != null) {
                             text = text + "</b>";
                        else {
                             text = "</b>";
                   try {
                        if (text != null) {
                             text = text + messageDoc.getText(i,1);
                        else {
                             text = messageDoc.getText(i, 1);
                   catch (BadLocationException e) {
                        System.out.println("An error occurred while getting the text from the message document");
                        e.printStackTrace();
              return text;
         } // end getMessageText()When the message is sent to the other client, the program searches through the received message and changes the text between the bold tags to bold. This seems as if it should work, but as soon as I click on the bold button, I get a StateInvariantError. The code for my button is:
    public void actionPerformed(ActionEvent evt) {
              if (evt.getSource() == bold) {
                   MutableAttributeSet bold = new SimpleAttributeSet();
                   StyleConstants.setBold(bold, true);
                   messageText.getStyledDocument().setCharacterAttributes(messageText.getSelectionStart(), messageText.getSelectionStart() - messageText.getSelectionEnd() - 1, bold, false);
         } //end actionPerformed()Can anyone help me to figure out why this error is being thrown? I have searched for a while to figure out this way of doing what I'm trying to do and I've found out that a StateInvariantError has been reported as a bug in several different circumstances but not in relation to this. Or, if there is a better way to add and check the style of the text that would be great as well. Any help is much appreciated, thanks in advance.

    Swing related questions should be posted in the Swing forum.
    Can't tell from you code what the problem is because I don't know the context of how each method is invoked. But it would seem like you are trying to query the data in the Document while the Document is being updated. Try wrapping the getMessageText() method is a SwingUtilities.invokeLater().
    There is no need to write custom code for a Bold Action you can just use:
    JButton bold = new JButton( new StyledEditorKit.BoldAction() );Also your code to build the text String is not very efficient. You should not be using string concatenation to append text to the string. You should be using a StringBuffer or StringBuilder.

  • ALV Grid Control -  Modifiy data in total and subtotal lines

    Hello all,
    I´am creating a report using ALV Grid Control. This report calculates (using delivered and returned materials) for each vendor/material-combination the return quote.
    Using the totals and subtotals function for different characteristics I want to calculate the return quote for the selected characteristic. Example:
    Material delivered returned quote
    ..4711 . . . 500 . . . 5 . . . . 1 (=returned*100/delivered)
    ..4711 . . . 400 . . . 10 . . . . 2,5
    . SUM . . . 900 . . . 15 . . . . 3,5 <-- 3,5 is the sum but I want display the calculated value 1,667
    Is there a possibility to modify data in the total and subtotal lines.
    Thank you for your answer
    Best regards
    Thomas

    you said instead of 3.5 you want to show 1,667 ..
    how is it possible...
    3,5 become 1,667
    i thought you are doing any conversions...
    vijay

  • How to call an Oracle Procedure and get a return value in Php

    Hi Everyone,
    Has anyone tried calling an Oracle procedure from Php using the ora functions and getting the return value ? I need to use the ora funtions (no oci)because of compatibility and oracle 7.x as the database.
    The reason why I post this here is because the ora_exec funtion is returning FALSE but the error code displayes is good. Is this a bug in the ora_exec funtion ?
    My code after the connection call is as follows:
    $cur = ora_open($this->conn);
    ora_commitoff($this->conn);
    $requestid = '144937';
    echo $requestid;
    $rc = ora_parse($cur, "begin p_ins_gsdata2
    (:requestid, :returnval); end;");
    if ($rc == true) {
    echo " Parse was successful ";
    $rc2 = ora_bind ($cur, "requestid", ":requestid", 32, 1);
    if ($rc2 == true) echo " Requestid Bind Successful ";
    $rc3 = ora_bind ($cur, "returnval", ":returnval", 32, 2);
    if ($rc3 == true) echo " Returnval Bind Successful ";
    $returnval = "0";
    $rc4 = ora_exec($cur);
    echo " Result = ".$returnval." ";
    if ($rc4 == false) {
    echo " Exec Returned FALSE ";
    echo " Error = ".ora_error($cur);
    echo " ";
    echo "ErrorCode = ".ora_errorcode($cur);
    echo "Error Executing";
    ora_close ($cur);
    The Oracle procedure has a select count from a table and it returns the number of records in that table. It's defined as:
    CREATE OR REPLACE procedure p_ins_gsdata2 (
    p_requestid IN varchar2 default null,
    p_retcode OUT varchar2)
    as
    BEGIN
    SELECT COUNT (*) INTO p_retcode
    FROM S_GSMRY_DATA_SURVEY
    WHERE request_id = p_requestid ;
    COMMIT;
    RETURN;
    END;
    Nothing much there. I want to do an insert into a table,
    from the procedure later, but I figured that I start with a select count since it's simpler.
    When I ran the Php code, I get the following:
    144937
    Parse was successful
    Requestid Bind Successful
    Returnval Bind Successful
    Result = 0
    Exec Returned FALSE
    Error = ORA-00000: normal, successful completion -- while
    processing OCI function OBNDRA
    ErrorCode = 0
    Error Executing
    I listed the messages on separate lines for clarity. I don't understand why it parses and binds o.k. but the exec returns false.
    Thanks again in advance for your help. Have a great day.
    Regards,
    Rudi

    retcode=`echo $?`is a bit convoluted. Just use:
    retcode=$?I see no EOF line terminating your input. Your flavour of Unix might not like that - it might ignore the command, though I'd be surprised (AIX doesn't).
    replace the EXEC line with :
    select 'hello' from dual;
    and see if you get some output - then you know if sqlplus commands are being called from your script. You didn't mentioned whether you see the banner for sqlplus. Copy/paste the output that you get, it will give us much more of an idea.

  • 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.

  • PDF and RTF output differences

    Hi All
    I'm having some issues when previewing labels in PDF and RTF output. I have created a RTF template that outputs labels - 5 address lines per label, 2 X 10 labels per page. Each label is contained in a table and each address line is contained in a table row.
    - When I preview the RTF output long address lines are not being truncated even though I uncheck the wrap option on the table cell properties.
    - When I preview the RTF output I can get 2x10 labels on the page (if no wrapping occurs) but when I preview in PDF I can only get 2x9 labels on the page. I have checked the font size of both the PDF and RTF outputs and they are the same size. It looks like the header and footer is taking up more space on the PDF version compared to the RTF version when I visually inspect the output but I cannot be sure.
    Does anyone have any ideas how to resolve these issues?
    regards
    Brad

    Always its better to use different templates for individual output types as the template designed with perfection for pdf output type dosen't comply with rtf or any other type and vice versa.
    Cheers!
    Vishnu T Ramakrishnan

  • Modify amount of space after line return

    hi
    I'm creating a html email (using a table and a new inline style each time i insert text, as advised)
    However, this query may apply to any form of html produced in dreamweaver:
    Can I set and modify the amount of space inserted after a line return?
    I know shift+return gives standard space but I'd like to ideally insert a slightly bigger space than this (although not as big a full "return" gives)
    Surely this must be possible?
    All help appreciated
    Tom

    Hi Tom,
    Hitting the enter key gives you a paragraph tag <p>  </p>
    Paragraphs have a default margin so you need to change that margin.To change/adjust the margin on all paragraphs on your page use css.
    Add it to the head of the page between style tags or to an external stylesheet:
    p {margin: 5px 0 0;}
    The above sets margin 5 pixels top 0 pixels right/left 0 pixels bottom. Adjust as per your need.
    Thanks
    Bhawna

  • JTextPane and CRLF

    Hi, I have a simple editor that can save and read files, I use a JTextPane for the text entry. In brief, my question is: How to get a JTextPane to display CRLF as one character?
    I've noticed that when I type into the text pane and hit enter/return it inserts one character, so for example if I type:
    test string and return
    and right after I hit return I left arrow twice my cursor is between 'r' and 'n'. But when I save that file to Windows, the return is saved as a CRLF, 2 characters. If I open the file, read it into the document model and display it, there is a 2 character CRLF, so in the above example I would have to use the left arrow 3 times to get between 'r' and 'n'. I don't want to fool with the document itself, can someone tell me how to get the JTextPane to display CRLF as one character?
    Thanks!

    I've never seen a JTextPane behave as described, but there can be a difference between
    1) the number of characters displayed in a JTextPane
    2) the number of characters written to a file
    See this thread for an explanation:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=397160

  • Forced *^$$#% Line Returns!

    I have suffered this problem for too long now. It is in just
    about everything I do, web design, blog editors what have you.
    I would guess 90% of the time I do not want a line return
    after I type a word or phrase.
    Back in my FRONTPAGE days I got around that by using ADDRESS
    and then removing the italics.
    In the project I am working on I cant use CSS because I am
    exporting it to something else.
    Its a side bar with perhaps 40 graphics and 100 different
    lines of words or phrases. I want to put in some HTML code at the
    top and bottom to make ALL LINE RETURNS to away. FOREVER AND EVER!
    So what am I missing here?
    Is this going to be something really simple that is going to
    embarrass me?. :)
    RJ

    <p>
    poopyhead</p>
    Not sure about the nasty webforum tags there, but this would
    be a standard
    paragraph of text.
    poopyhead<br>
    This is an isolated line of text - invalid if not within some
    other
    container, like <p>, <h#>,
    <div>,<td>, etc. - followed by a line break,
    following HTML4x tag syntax. This line would be invalid on a
    page with an
    XHTML doctype.
    poopyhead<br />
    Ditto above, except following XHTML tag syntax. This line
    would be invalid
    on a page with an HTML doctype.
    >I have put that code in the blog.css file over and over
    again to no avail.
    > I think the blog editor overrides it or something. I
    Even put those
    > IMPORTANT!s behind it. :)
    I suppose we'd have to know about your blog editor.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "rack22" <[email protected]> wrote in
    message
    news:f07ru7$2k5$[email protected]..
    >I have put that code in the blog.css file over and over
    again to no avail.
    > I think the blog editor overrides it or something. I
    Even put those
    > IMPORTANT!s behind it. :)
    >
    > How about HTML code I can force into the top of the
    SOURCE area of the
    > editor?
    > How does
    work? Is that right? li ?
    >
    > Can anyone tell me the difference between these?
    >
    > <p>
    poopyhead</p>
    >
    poopyhead<br>
    >
    poopyhead<br />
    >
    > rj
    >

  • BAPI Error FF818 : Line-by-line taxes active and therefore line-by-line transfer mandatory

    Hi,
    Line-by-line taxes active and therefore line-by-line transfer mandatory - Error FF818.
    Error FF-818 With BAPI - BAPI_ACC_DOCUMENT_POST or BAPI_ACC_INVOICE_RECEIPT_POST , when I was trying to post Incoming vendor invoice without PO (FB60 Transaction code).
    I could able to post the document successfully, if I can populate the below three fields in DOCUMENTHEADER, but the BAPI return doesnt populate the generated document number as well as BKPF-AWKEY is populated with value '$'. Which is not acceptable in an IDoc scenario as we can see the document number in the return message as '$'.
    OBJ_TYPE = BKPFE
    OBJ_KEY  = $
    OBJ_SYS  = xxxxxxxx
    Any one faced same issue ?? Below are the populated values .
    DOCUMENTHEADER
    OBJ_TYPE                       BKPFE
    OBJ_KEY                        $
    OBJ_SYS                        XXXXX
    BUS_ACT                        RFBU
    USERNAME                       XXXXXXX
    HEADER_TXT                     TEST1234
    COMP_CODE                      1000
    DOC_DATE                       05/01/2014
    PSTNG_DATE                     05/01/2014
    TRANS_DATE                     05/01/2014
    FISC_YEAR                      2014
    FIS_PERIOD                     05
    DOC_TYPE                       ZN
    REF_DOC_NO                     TESTSTSTS_IN
    ACCOUNTGL
    ITEMNO_ACC                     0000000002
    GL_ACCOUNT                     603344
    ITEM_TEXT                      TEST111_CM
    PSTNG_DATE                     05/01/2014
    TAX_CODE                       I1
    TAXJURCODE                     1000000000
    ITEMNO_TAX                     000003 ( Tried populating this field with all the values including zeros)
    ACCOUNTPAYABLE
    ITEMNO_ACC                     0000000001
    VENDOR_NO                      8266666
    BLINE_DATE                     04/30/2014
    ACCOUNTTAX
    ITEMNO_ACC                     0000000003
    GL_ACCOUNT                     200000
    COND_KEY                       XP1I
    ACCT_KEY                       NVV
    TAX_CODE                       I1
    TAX_RATE                          60.000
    TAX_DATE                       04/30/2014
    TAXJURCODE                     1000000000
    TAXJURCODE_DEEP                1000000000
    TAXJURCODE_LEVEL
    ITEMNO_TAX                     000001 ( Tried populating this field with all the values including zeros)
    DIRECT_TAX                     X ( Tried X and ' ')
    CURRENCYAMOUNT
    ITEMNO_ACC                     0000000001
    CURR_TYPE                      00
    CURRENCY                       USD
    AMT_DOCCUR                     100.0000-
    AMT_BASE                       100.0000
    ITEMNO_ACC                     0000000002
    CURR_TYPE                      00
    CURRENCY                       USD
    AMT_DOCCUR                     100.0000
    AMT_BASE                       100.0000
    ITEMNO_ACC                     0000000003
    CURR_TYPE                      00
    CURRENCY                       USD
    AMT_DOCCUR                     60.0000-
    AMT_BASE                       100.0000
    I Tried without populating the tax line items, but still the same error message and If I populate those three values in the header structure, all we can see is '$' in return.
    -Thanks,
    Veeru.

    HI,
    the note 1995144 which explains why this error happens
    and which also provides an example implementation for BAdI
    BADI_REEX_FI_BAPI.
    Regards,
    Bowen

  • Hello I am on a macbook pro (retina IOS 9) i have installed xcodes and command line tools but codeblocks does not compile, terminal gives this message /Users/MacPc/Desktop/Untitled1: Permission denied      any one has a solution

    Hello I am on a macbook pro (retina IOS 9) i have installed xcodes and command line tools but codeblocks does not compile, terminal gives this message /Users/MacPc/Desktop/Untitled1: Permission denied      any one has a solution?? please...

    Back up all data before proceeding.
    This procedure will unlock all your user files (not system files) and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
               ▹ Restart
    from the menu bar.

Maybe you are looking for

  • TS4002 Icloud data restore from one Apple ID to another?

    I had to replace my 4S with another.  I originally set up icloud on phone "1" (now not working) to back up contact, data, etc with a specific Apple ID.  The person who set up icloud on phone "2" used a different aApple ID.  How do I get the data from

  • How can I print an address card?

    Hi Folks, I've just discovered what seems like a ridiculous limitation of Address Book. I am having a hard time believing this is so, and am sure there must be a way to do this. I need to print out an address card, as it appears in the Address Book.

  • E90 - attachments in Gmail

    Hi all, I have a problem with working on Gmail. When I try to download attachment I'm not able to do so. Also, when I click on "View" option to see attached image, browser opens new window but it doesn't display the image. 9500 didn't have this probl

  • Where do screen shots get stored on a Mac Book?

    I've been using command-control-shift-4 but then I get the camera noise and I have no idea where the photo ends up.

  • Motion 3 template drop zone content won't play in FCP

    I am new to Motion. I made a custom template and brought it into FCP. It inserts and previews fine. In FCP I place a clip into one of the masked-out "drop zones" under the "controls tab" and here is where I run into the problem: The clip shows up ok