Loading String in JTextArea/JTextPane

I'm trying to create an app that will display long Strings (veeerry looong and I know this is very easy) on the screen. When I display the String on screen, it should change the colors of certain text on the fly (much like many IDEs now). This is not necessarily required of the app but it would be good to have. My problem now lies in the fact that I originally used JTextArea, which worked very fine, loading the files very fast, too. Now, in order for me to be able to change the colors of the text, I have to switch to a JTextPane (not much change in code). I haven't even gotten to the point of making it change the text's colors, I've just changed my code to use JTextPane instead of JTextArea (shown below) but the speed of loading the file was so much affected. It's like the JTextPane is several times slower than JTextArea.
   //JTextArea txtDisplay = new JTextArea();
   JTextPane txtDisplay = new JTextPane();
   timer.start();
   txtDisplay.setText(aVeryLongString);
   timer.end();
   System.out.println(timer.status());
   ...After running this, using JTextArea, the timer.status() returns 3 seconds. Using the JTextPane() returns something like 10-15 seconds.
Appreciate help fom anyone.

Try something like this :
JTextPane txtDisplay = new JTextPane();
BufferedReader reader = new BufferedReader(new FileReader(big.txt));
String line = null;
while((line = reader.readLine()) != null) {
txtDisplay.insertString(txtDisplay.getDocument().getLength(),line,null);
Bye,
Evert

Similar Messages

  • Bug in JTextArea/JTextPane ??

    Hi,
    I am facing huge memory leak problems with JTextArea/JTextPane. After considerable investigation, I found out that the Document associated with the component is not being GC'ed properly. I ran OptimizeIt and found out that the memory is being consumed by the JTextPane.setText() method. I have implmented a HTML viewer to display large amounts of HTML data and it is leaking memory like crazy on each successive execution. Any thoughts ??
    JDK1.4.2_01, WinXP
    Here is the code fragment:
    public class ReportViewer extends BaseFrame implements FontChange_int
         private     String          cReport;          
         private boolean          testMode = false;     
         // Graphical components
         private     BorderLayout     cMainLayout;
         private     JButton          cClose;
         private     JTextPane     cRptPane;
         private     Button          cClose2;
         private ViewUpdater cViewUpdater = null;
         // Constants
         final     static     int     startupXSize = 650;
         final     static     int     startupYSize = 500;
         // Methods
         public ReportViewer(String report, ReportMain main)
              // BaseFrame extends JFrame
              super("Reports Viewer", true, startupXSize, startupYSize);
              testMode = false;
              cReport = report;
              cViewUpdater = new ViewUpdater();
              initialize();
         public void initialize()
              // Create main layout manager
              cMainLayout = new BorderLayout();
              getContentPane().setLayout(cMainLayout);
              // Quick button bar - print, export, save as
              JToolBar     topPanel = new JToolBar();
              topPanel.setBorder(new BevelBorder(BevelBorder.RAISED) );
              java.net.URL     url;
              topPanel.add(Box.createHorizontalStrut(10));
              url = Scm.class.getResource("images/Exit.gif");
              cClose = new Button(new ImageIcon(url), true);
              cClose.setToolTipText("Close Window");
              topPanel.add(cClose);
              getContentPane().add(topPanel, BorderLayout.NORTH);
              // Main view window - HTML
              cRptPane = new JTextPane();
              cRptPane.setContentType("text/html");
              cRptPane.setEditable(false);
              JScrollPane sp = new JScrollPane(cRptPane);
              getContentPane().add(sp, BorderLayout.CENTER);
              // Main button - Close
              JPanel     bottomPanel = new JPanel();
              url = Scm.class.getResource("images/Exit.gif");
              cClose2 = new Button(new ImageIcon(url), "Close");
              bottomPanel.add(cClose2);
              getContentPane().add(bottomPanel, BorderLayout.SOUTH);
              cClose.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        closeWindow();
              cClose2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        closeWindow();
              show();
              cViewUpdater.setText(cReport);
              SwingUtilities.invokeLater(cViewUpdater);
         protected void
         closeWindow()
              super.closeWindow();
              // If I add the following lines, the GC reclaims
    // part of the memory but does not flush out the text
    // component as a whole
              /*Document doc = cRptPane.getDocument();
              try
                   doc.remove(0,doc.getLength());
              catch(Exception e) {;}
              doc=null; */
              cRptPane=null;
              cReport = null;
              cViewUpdater = null;
              dispose();
         private class ViewUpdater implements Runnable
              private String cText = null;
              public ViewUpdater() {;}
              public void
              setText(String text) {
                   cText = text;
              public void
              run() {
                   cRptPane.setText(cText);
                   cRptPane.setCaretPosition(0);
                   cText = null;
         // Local main - for testing
         public static void main(String args[])
              //new ReportViewer(str,comp);
    Sudarshan
    www.spectrumscm.com

    Hi,
    I am facing huge memory leak problems with JTextArea/JTextPane. After considerable investigation, I found out that the Document associated with the component is not being GC'ed properly. I ran OptimizeIt and found out that the memory is being consumed by the JTextPane.setText() method. I have implmented a HTML viewer to display large amounts of HTML data and it is leaking memory like crazy on each successive execution. Any thoughts ??
    JDK1.4.2_01, WinXP
    Here is the code fragment:
    public class ReportViewer extends BaseFrame implements FontChange_int
         private     String          cReport;          
         private boolean          testMode = false;     
         // Graphical components
         private     BorderLayout     cMainLayout;
         private     JButton          cClose;
         private     JTextPane     cRptPane;
         private     Button          cClose2;
         private ViewUpdater cViewUpdater = null;
         // Constants
         final     static     int     startupXSize = 650;
         final     static     int     startupYSize = 500;
         // Methods
         public ReportViewer(String report, ReportMain main)
              // BaseFrame extends JFrame
              super("Reports Viewer", true, startupXSize, startupYSize);
              testMode = false;
              cReport = report;
              cViewUpdater = new ViewUpdater();
              initialize();
         public void initialize()
              // Create main layout manager
              cMainLayout = new BorderLayout();
              getContentPane().setLayout(cMainLayout);
              // Quick button bar - print, export, save as
              JToolBar     topPanel = new JToolBar();
              topPanel.setBorder(new BevelBorder(BevelBorder.RAISED) );
              java.net.URL     url;
              topPanel.add(Box.createHorizontalStrut(10));
              url = Scm.class.getResource("images/Exit.gif");
              cClose = new Button(new ImageIcon(url), true);
              cClose.setToolTipText("Close Window");
              topPanel.add(cClose);
              getContentPane().add(topPanel, BorderLayout.NORTH);
              // Main view window - HTML
              cRptPane = new JTextPane();
              cRptPane.setContentType("text/html");
              cRptPane.setEditable(false);
              JScrollPane sp = new JScrollPane(cRptPane);
              getContentPane().add(sp, BorderLayout.CENTER);
              // Main button - Close
              JPanel     bottomPanel = new JPanel();
              url = Scm.class.getResource("images/Exit.gif");
              cClose2 = new Button(new ImageIcon(url), "Close");
              bottomPanel.add(cClose2);
              getContentPane().add(bottomPanel, BorderLayout.SOUTH);
              cClose.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        closeWindow();
              cClose2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        closeWindow();
              show();
              cViewUpdater.setText(cReport);
              SwingUtilities.invokeLater(cViewUpdater);
         protected void
         closeWindow()
              super.closeWindow();
              // If I add the following lines, the GC reclaims
    // part of the memory but does not flush out the text
    // component as a whole
              /*Document doc = cRptPane.getDocument();
              try
                   doc.remove(0,doc.getLength());
              catch(Exception e) {;}
              doc=null; */
              cRptPane=null;
              cReport = null;
              cViewUpdater = null;
              dispose();
         private class ViewUpdater implements Runnable
              private String cText = null;
              public ViewUpdater() {;}
              public void
              setText(String text) {
                   cText = text;
              public void
              run() {
                   cRptPane.setText(cText);
                   cRptPane.setCaretPosition(0);
                   cText = null;
         // Local main - for testing
         public static void main(String args[])
              //new ReportViewer(str,comp);
    Sudarshan
    www.spectrumscm.com

  • Keep getting "error in loading string XML error is Z and ACP Main Resource DLL failed

    Firefox is constantly crashing. When it restarts I get this error messages: "error in loading string XML error is Z and another error message "ACP Main--Resource DLL Failed"
    I don't know if these messages are associated with Firefox or something else; however, my response time is just awful with Firefox and it is getting worse!

    My understanding of exception stack trace is that the two class loader are unable to match the argument type org/springframework/core/io/Resource in original method and its overridden method. And original method class loader and overridden method class loader are different.
    This normally happens due to class clashes.

  • How to highlight Search string in JTextArea??

    I have a Search utility which search for a string in JTextArea. Search utility is able to locate the search string but it does not highlight it.
    Please let me know if you know what could be wrong
    Thanks
    Amit

    You have to highlight the string yourself. Try using:
    textArea.setSelectionStart( int );
    textArea.setSelectionEnd ( int );

  • Seprating string in JTextArea

    hi,
    I want to seprate the string in JTextArea.Any Suggestions....?
    Thanx

    i want to seprate it by words to display two different words in different colour How where we supposed to guess that you wanted to colour words based on your intial question?
    Learn to post meaningfull questions with all the necessary information required to solve the problem so we don't waste time guessing what you really mean.
    [url http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html]Text Component Features

  • Load HTML in a JTextPane

    Hallo,
    i try to load a simple html file into a JTextPane and then print out this file. I ve noticed, that my last (empty) td-tag-pair disapear. Why this happens? How can i avoid this?
    thanks
    bye
    my html file:
    <html>
      <head>
      </head>
      <body>
        <table border="1" height="200" style="border-style: solid" width="400">
          <tr>
            <td style="border-style: solid">
              1
            </td>
            <td style="border-style: solid">
              2
            </td>
           <td style="border-style: solid">
            </td>
          </tr>
        </table>
      </body>
    </html>and my java programm:
    import java.io.File;
    import javax.swing.JFrame;
    import javax.swing.JTextPane;
    import javax.swing.text.html.HTMLDocument;
    public class HTMLTest {
         public static void main(String[] args) {
              try {
                   JFrame frame = new JFrame();
                   frame.setSize(400,300);
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   JTextPane pane = new JTextPane();
                   HTMLDocument doc = (HTMLDocument) pane.getEditorKitForContentType("text/html").createDefaultDocument();
                   doc.setAsynchronousLoadPriority(-1);
                   pane.setDocument(doc);
                   File f = new File("1.html");
                   pane.setPage(f.toURL());
                   frame.add(pane);
                   frame.setVisible(true);
                   System.out.println(pane.getText());//Here it happens! Where is my last (empty) td-tag-pair?
              } catch (Exception e) {
                   e.printStackTrace();
    }

    Hey,
    It works fine for me.....Ur empty tag is showing up!......and one more suggestion is don't add data directly to JFrame..u have to call...getContentPane()..and add it...may be u have posted that thing wrongly ..anyway i have modified and it's working fine for me!

  • How can I load string type fielt into oracle table as a date?

    I have a date field in oracle table(target) and my source is ms sql server. In my source table I have string type field include date data like '20150501'. I wanna load that data into oracle as a date field. In my target table this field type is date. But I cant load that data. It seems empty.I use convert function and its format is mssql format. How can I achive this? thanks in advance

    시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]

  • Another help thread involving strings and jtextarea

    i have recently created a program, i have string message (which is made up of other strings created in my program) which i want to pass to a jtextarea box creating a list dont have a clue how to do so i tried using an arraylist but when i implemented it all it did was change the jtextarea output instead of creating a list. on top of this i have tried fixing it myself but only made the situation worse by deleting the way which i outputted the code, i have tried google but cant find an answer, any advice on my problem would be greatly appreciated
    if(e.getSource()==confirmation) {
       String message = "Your order of" + " " + mainDish+ " "+ "with"+ " "+ ingredients+ " "+ "costs" + " "+ pounds.format(bill);
       output.setText(message);
      if(e.getSource()==confirmationList) {
        ArrayList list = new ArrayList();
        list.add(output.getText()); 
        output.setText(" ");

    dbomb101 wrote:
    i have recently created a program, i have string message (which is made up of other strings created in my program) which i want to pass to a jtextarea box creating a list dont have a clue how to do so i tried using an arraylist but when i implemented it all it did was change the jtextarea output instead of creating a list. on top of this i have tried fixing it myself but only made the situation worse by deleting the way which i outputted the code, i have tried google but cant find an answer, any advice on my problem would be greatly appreciated
    if(e.getSource()==confirmation) {
    String message = "Your order of" + " " + mainDish+ " "+ "with"+ " "+ ingredients+ " "+ "costs" + " "+ pounds.format(bill);
    output.setText(message);
    if(e.getSource()==confirmationList) {
    ArrayList list = new ArrayList();
    list.add(output.getText()); 
    output.setText(" ");
    The biggest problem I see with your code is that you create a new ArrayList every time through your code segment. This will absolutely garentee that you only have at most 1 entry in your ArrayList.
    When you come into your code segment you create a new ArrayList
    When you go out of Scope, you loose the ArrayList
    So do you see a cyclic problem here?
    If you want your ArrayList to contain an accumulation of your output, then you have to make your ArrayList a class variable.

  • Removal of String from JTextArea

    Does anyone know how to remove a string from a JTextArea. The folowing do not work
    t1.remove(s1);
    t1.delete(s1);
    t1 being the text area and s1 the string

    Hello,
    If you want to "clear" the string, it's "setText("")".
    If you want do remove part of the string, its a little bit more complex ...
    String temp = getText();
    remove the string from the temp String
    setText(temp);
    I hope this help

  • Drag & Drop from JTree (String) to JTextArea (Graphics2D)

    Hi everyone,
    I want to create a Drag & Drop from a JTree node to any location in a JTextArea. Upon dropping the node onto the JTextArea, I would want to draw a rectangle and the node name.
    I've created a custom transfer handler which allows the transferring of text from the tree node to the JTextArea.
    Any general ideas on how I can do that are wlecomed.

    I've managed to get hold of the JPanel via TransferHandler.TransferSupport.getComponent()
    the source seems a bit more tricky. I've tried this
    Transferable tr = support.getTransferable();
                   DataFlavor f = new DataFlavor();
                   f = new DataFlavor(MyTreeNode.class,"MyTreeNode");
                   try {
                        Object o = tr.getTransferData(f);...
    but the source does not provide a MyTreeNode instance, but something else (a String, I guess)
    how can I change this?

  • Loading string to xmlDocument using c#

    strDetails ="<ApplicationName>" + appname + "</ApplicationName>" + "<Status>" + appstatus + "</Status>" +
    "<RecPort>" + receiveport1 + "</RecPort>" +
    "<SendPort>" + Sendport1 + "</SendPort>" +
    "<Orchestration>" + orchestration1 + "</Orchestration>" +
    "<Transform>" + transform1 + "</Transform>"
    + "<Pipeline>" + pipeline1 + "</Pipeline>" + "</ApplicationName>";
    Hello,
    I have a string variable as shown above,
    I want to load that string variable (getting new values everytime) to xml file
    the string variable getting new values everytime, so how to make that as next child record.
    Please help..
    Thanks

    Hi Val10,
    I tried this
    It showing error saying : multiple root nodes
    Can you please check what could be the error below is what I am trying to do,
    foreach (Microsoft.BizTalk.ExplorerOM.Application app in catalog.Applications)
    appname = app.Name;
    appstatus = Convert.ToString(app.Status);
    foreach (ReceivePort Recv in app.ReceivePorts)
    receiveport = Recv.Name + ", ";
    receiveport1 = receiveport1 + receiveport;
    foreach (SendPort sen in app.SendPorts)
    Sendport = sen.Name + ", ";
    Sendport1 = Sendport1 + Sendport;
    foreach (BtsOrchestration orch in app.Orchestrations)
    orchestration = orch.FullName + ", ";
    orchestration1 = orchestration1 + orchestration;
    foreach (Transform trans in app.Transforms)
    transform = trans.FullName + ", ";
    transform1 = transform1 + transform;
    foreach (Pipeline pipe in app.Pipelines)
    pipeline = pipe.FullName + ", ";
    pipeline1 = pipeline1 + pipeline;
    } string strDetails = "<ApplicationName>" + appname + "</ApplicationName>" + "<Status>" + appstatus + "</Status>" +
    "<RecPort>" + receiveport1 + "</RecPort>" +
                       "<Pipeline>" + pipeline1 + "</Pipeline>" ;
                string main = "<Apps></Apps>";
                System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                doc.LoadXml(main);
                System.Xml.XmlNode root = doc.DocumentElement;
                 doc.LoadXml(strDetails);
                 System.Xml.XmlNode node = doc.DocumentElement;
                 root.AppendChild(node);

  • Load String into CharArray and then Print String in Reverse?

    Hey, what would the code be to:
    1. Ask user for name. (scanner)
    2. Load his name into a CharArray.
    3. Then print out his name backwards.
    thanks a lot!

    dforevergold has a head on his neck. So, I don't understand people saying about assignments etc... If he needs help and we can help then we must help.
    Here's the code (but don't forget about comments!):
    import java.util.Scanner;
    public class Just {
         public static void main(String[] args) {
              // a scanner to get user's input
              Scanner scan = new Scanner(System.in);
              // Scanner.nextLine() returns the entered line
              String name = scan.nextLine();
              // toCharArray() converts a 'String' object to a 'char[]' object
              char[] ch = name.toCharArray();
              // next FOR-loop goes from the last element in the array to the first one and prints them onscreen
              for (int i = ch.length - 1; i >= 0; --i) System.out.print(ch);
    I hope it helps you!
    Yours Sincerely,
    Nikaustr

  • Drag and Drop in a JTextArea (JTextPane)

    Hello everybody!
    I�ve a litte problem. I�m writing an online HTML-Editor as an Applet.
    Everything works fine, only drag&drop isn�t implemented yet.
    I�m using a JTextArea and a HTMLEditorKit in a SplitPane.
    Now i want to add drag&drop to each Pane. I need it urgent in the HTMLEdtiorKit , because it should be possible to drag and drop pics and text in the same pane.
    How can I add these feature ?!
    Maybe someone could write me a little example for a jTextArea oder a HTMLEditorKit ?!
    I�m actually using JDK.1.3.1, is there a big difference between 1.3.1 and 1.4 ?!
    Thanks,
    Ren�

    for those interested (if there is), i've given up on leadselectionpath, and i draw my outline manually, by overloading paintComponent and using the getPathBounds method.
    still, i don't know what leadselectionpath means... well, i guess i don't need to know, but if anyone want to share his knowledge...
    nicolas

  • How to use ZoneView in a JTextArea or JTextPane?

    i would like to view an large file (25MB with about 600.000 rows) in a JTextArea or JTextPane. As I know the JTextArea creates for each line of the document at least one object, due to this fact it consumes about 330MB (for the file mentioned above) of memory and is useless. Now i found the ZoneView/AsyncBoxView for displaying and consuming memory only for the zone which has to be displayed. But how can i use the ZoneView in a JTextArea? Any examples?
    Thanx,
    Oliver

    Hi Folks:
    I would like some examples of using ZoneView as well. I read 1Mb files and convert them to strings and them attempt to render that entire string onto a JTextPane. As I understand it, ZoneView will improve the time to render the string on the JTextPane.
    My code is something like:
    final String fileToString = readInput();
    textPane.setText(fileToString);
    //readInput() is a file reader method
    The files (or strings) have upwards of 1000 lines; this takes a coupla minutes to render on a text pane.
    Hopefully they will post an example of ZoneView soon. Or maybe put it on the Question of the Week?!
    -Ben

  • How to replace a particular striing with another string in jtextpane

    how to get replace a particular string with another string of a jtextpane without taking the text in a variable using getText() method .

    Thanks for your answer,
    "relevant object" means for you datasources, transfer rules and transformations ?
    With the grouping option "Save for system copy" I can't take easily all datasources, and others objects
    Will I have to pick all object one by one ?
    What would be the adjustement in table RSLOGSYSMAP ? For the moment it's empty.
    Regards
    Guillaume P.

Maybe you are looking for

  • How to build a gantt chart with BI Publisher

    Hi everybody, I need to create a gantt chart with BI Publisher. I had a look to the document "Getting Gantty" from the blog: http://blogs.oracle.com/xmlpublisher/2008/01/getting_gantty.html but I don't understand in which way: 1. build the data templ

  • Customization of DAC to send emails in XML format

    Hi, We need to customize DAC to send emails in XML format to the support team whenever there is a failure of the ETL load. We use the HPSC ticketing system. Any help to achieve this functionality is much appreciated. we have tried to customize the ex

  • Best modem/router for AEBS that actually works?!

    Hi, I have had so many problems with my AEBS it's unbelievable! If someone could suggest a modem/router that works well with the AEBS so i can set up my wireless network that would be great! So far i have tried the netgear DM111P modem & the d-link 3

  • Definition of special days in t553s with type = 0 vs. Calendar holiday

    Hi everyone, What must be the compute of a day which i have defined like public holiday in the company calendar and in the same time is in t553s like a special day with type = 0 (working day). Which of them has more priority? If the one with more pri

  • Planning Systems: MRPII, ERP and ERPII

    Hello, my name is Omolade and am studying MSc Management at the University of Sheffield. We have been looking at MRPII, ERP and ERPII systems in an Operations Management module. I have theory that a MRPII can be updated or at the least customised to