Help with displaying my xml file in my jtext area

Hi i am trying to read the data from my xml file and display it once the user clicks on the list all button.
below is the source code for my program can someone please tell me some code to this.
package tractorgui;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.XMLEncoder;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.beans.XMLDecoder;
import javax.swing.*;
import javax.swing.border.LineBorder;
//import tractor.TextInputPrompt;
import tractor.Tractor;
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo isbeing used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
public class NewSwingApp extends javax.swing.JFrame {
//          //Set Look & Feel
//          try {
//               javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
//          } catch(Exception e) {
//               e.printStackTrace();
          private static final long serialVersionUID = 1L;
     private JButton searchmanufacturer;
     private JButton jButton3;
     private JLabel companyname;
     private JPanel labelpannel;
     private JButton listall;
     private JPanel MenuButtons;
     private JButton archivetractor;
     private JTextArea outputscreen;
     private JButton exhibittractor;
     private JButton deletetractor;
     private JButton addtractor;
     private JButton listallexbited;
     private Tractor [ ] tractors;
     private JScrollPane jScrollPane2;
     private JScrollPane jScrollPane1;
private int numberOfTractors;
     * Auto-generated main method to display this JFrame
     public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    NewSwingApp inst = new NewSwingApp();
                    inst.setLocationRelativeTo(null);
                    inst.setVisible(true);
     public NewSwingApp() {
          super();
          initGUI();
     private void initGUI() {
          try {
               BorderLayout thisLayout = new BorderLayout();
               getContentPane().setLayout(thisLayout);
               this.setPreferredSize(new java.awt.Dimension(750, 700));
                    labelpannel = new JPanel();
                    BorderLayout labelpannelLayout = new BorderLayout();
                    getContentPane().add(labelpannel, BorderLayout.NORTH);
                    labelpannel.setLayout(labelpannelLayout);
                    jButton3 = new JButton();
                    getContentPane().add(getExitsystem(), BorderLayout.SOUTH);
                    jButton3.setText("Exit System");
                    jButton3.setPreferredSize(new java.awt.Dimension(609, 57));
                    jButton3.setBackground(new java.awt.Color(0,255,255));
                    jButton3.setForeground(new java.awt.Color(0,0,0));
                    jButton3.setFont(new java.awt.Font("Arial",1,24));
                    jButton3.addActionListener(new ActionListener() {
                         public void actionPerformed(ActionEvent evt) {
                                        System.exit(0);
                    MenuButtons = new JPanel();
                    getContentPane().add(MenuButtons, BorderLayout.WEST);
                    GridLayout MenuButtonsLayout = new GridLayout(7, 1);
                    MenuButtonsLayout.setColumns(1);
                    MenuButtonsLayout.setRows(7);
                    MenuButtonsLayout.setHgap(5);
                    MenuButtonsLayout.setVgap(5);
                    MenuButtons.setLayout(MenuButtonsLayout);
                    MenuButtons.setPreferredSize(new java.awt.Dimension(223, 267));
                         listall = new JButton();
                         MenuButtons.add(getListall());
                         listall.setText("List All");
                         listall.setBackground(new java.awt.Color(0,255,255));
                         listall.setForeground(new java.awt.Color(0,0,0));
                         listall.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
                         listall.setFont(new java.awt.Font("Arial",2,14));
                         listall.addActionListener(new ActionListener() {
                              /* (non-Javadoc)
                              * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
                              public void actionPerformed(ActionEvent evt) {
                                   String XMLFile = "tractor.xml-courseworkasignment/src";
                                   //** Prints the contents of my XML file
                                   try {
                                   String s;
                                   BufferedReader in = new BufferedReader( new FileReader(XMLFile)
                                   outputscreen.setText("File successfully opened");
                                   try {
                                   while ( (s=in.readLine()) !=null)
                                   outputscreen.append(s);
                                   catch(Exception e) {
                                        outputscreen.append("Error reading line: " + e.getMessage());
                                   outputscreen.append("End of Document");
                                   catch(FileNotFoundException e) {
                                        outputscreen.append("Error in opening file: " + e.getMessage());
                         listallexbited = new JButton();
                         MenuButtons.add(getListallexbited());
                         listallexbited.setText("List All Tractors On Exhibition ");
                         listallexbited.setPreferredSize(new java.awt.Dimension(157, 57));
                         listallexbited.setBackground(new java.awt.Color(0,255,255));
                         listallexbited.setForeground(new java.awt.Color(64,0,0));
                         listallexbited.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                   outputscreen.repaint();
                                   String XMLFile = "C:tractor.xml";
                              // Print contents of XML file
                              try {
                              String s;
                              BufferedReader in = new BufferedReader( new FileReader(XMLFile)
                              outputscreen.setText("File successfully opened");
                              try {
                              while ( (s=in.readLine()) !=null)
                              outputscreen.append(s);
                              catch(Exception e) {
                                   outputscreen.append("Error reading line: " + e.getMessage());
                              outputscreen.append("End of Document");
                              catch(FileNotFoundException e) {
                                   outputscreen.append("Error in opening file: " + e.getMessage());
                         addtractor = new JButton();
                         MenuButtons.add(getAddtractor());
                         addtractor.setText("Add Tractor ");
                         addtractor.setBackground(new java.awt.Color(0,255,255));
                         addtractor.setForeground(new java.awt.Color(64,0,0));
                         addtractor.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                   String manufacturer =JOptionPane.showInputDialog(getComponent(0), "Enter Manufacturer of Tractor");
                                   String shp = (JOptionPane.showInputDialog(getComponent(0), "Enter Horse Power of Tractor"));
                                   int hp =Integer.parseInt(shp);
                                   int sisRare =Integer.parseInt(JOptionPane.showInputDialog(getComponent(0), "Enter If the Tractor is rare (1=Yes/2=No)"));
                                   boolean isRare;
                                   if (sisRare== 1) {
                                   isRare =true;     
                                   }else
                                        isRare =false;
                                   String yom= JOptionPane.showInputDialog(getComponent(0), "Enter Year of Manufacture");
                                   int yearOfManufacture =Integer.parseInt(yom);
                                   String yis =JOptionPane.showInputDialog(getComponent(0), "Enter Number of years the Tractor has been in service");
                                   int yearsInService =Integer.parseInt(yis);
                                   String svalue = JOptionPane.showInputDialog(getComponent(0), "Enter Tractor's Value (?Pounds)");
                                   double value = Double.parseDouble(svalue);
                                   String lastWorkPlace =JOptionPane.showInputDialog(getComponent(0), "Enter Last Workplace");
                                        if(NewSwingApp.addTractor(new Tractor(manufacturer, hp, isRare, yearOfManufacture, yearsInService, value, lastWorkPlace, false)))
                                   JOptionPane.showMessageDialog((getComponent(0)), "Tractor Added");
                                   else
                                        JOptionPane.showMessageDialog(getComponent(0), "Could not Add Tractor");
                         deletetractor = new JButton();
                         MenuButtons.add(getDeletetractor());
                         deletetractor.setText("Delete Tractor ");
                         deletetractor.setBackground(new java.awt.Color(0,255,255));
                         deletetractor.setForeground(new java.awt.Color(64,0,0));
                         deletetractor.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                   System.out.println("deletetractor.actionPerformed, event="+evt);
                                   JOptionPane.showInputDialog(getComponent(0), "Enter Tractor ID");
                         exhibittractor = new JButton();
                         MenuButtons.add(getExhibittractor());
                         exhibittractor.setText("Exhibit Tractor");
                         exhibittractor.setBackground(new java.awt.Color(0,255,255));
                         exhibittractor.setForeground(new java.awt.Color(0,0,0));
                         exhibittractor.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                   System.out.println("exhibittractor.actionPerformed, event="+evt);
                                   JOptionPane.showInputDialog(getComponent(0), "Enter Tractor I.D");
                         archivetractor = new JButton();
                         MenuButtons.add(getArchivetractor());
                         archivetractor.setText("Archive Tractor");
                         archivetractor.setBackground(new java.awt.Color(0,255,255));
                         archivetractor.setForeground(new java.awt.Color(0,0,0));
                         archivetractor.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                   System.out.println("archivetractor.actionPerformed, event="+evt);
                                   JOptionPane.showInputDialog(getComponent(0), "Enter Tractor I.D");
                         searchmanufacturer = new JButton();
                         MenuButtons.add(searchmanufacturer);
                         searchmanufacturer.setText("Search Manufacturer");
                         searchmanufacturer.setPreferredSize(new java.awt.Dimension(159, 21));
                         searchmanufacturer.setBackground(new java.awt.Color(0,255,255));
                         searchmanufacturer.setForeground(new java.awt.Color(64,0,0));
                         searchmanufacturer.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                   System.out.println("searchmanufacturer.actionPerformed, event="+evt);
                                   JOptionPane.showInputDialog(getComponent(0), "Enter Manufacturer Name");
                    outputscreen = new JTextArea();
                    getContentPane().add(outputscreen, BorderLayout.CENTER);
                    outputscreen
                              .setText("");
                    outputscreen.setBorder(BorderFactory.createTitledBorder(""));
                    outputscreen.setWrapStyleWord(true);
                    outputscreen.setEditable(false);
                    outputscreen.setEnabled(true);
                    outputscreen.setBackground(new java.awt.Color(255, 255, 255));
                    outputscreen.setForeground(new java.awt.Color(64, 0, 0));
                    companyname = new JLabel();
                    getContentPane().add(companyname, BorderLayout.NORTH);
                    companyname.setText(" Wolvesville Tractor Museum");
                    companyname.setPreferredSize(new java.awt.Dimension(609, 85));
                    companyname.setBackground(new java.awt.Color(255,255,0));
                    companyname.setFont(new java.awt.Font("Arial",1,28));
                    companyname.setForeground(new java.awt.Color(0,0,0));
                    companyname.setBorder(BorderFactory.createTitledBorder(""));
                    companyname.setOpaque(true);
               this.setSize(750, 750);
          } catch (Exception e) {
               e.printStackTrace();
     protected static boolean addTractor(Tractor tractor) {
               if (tractor.getManufacturer()==null) return false; else
               if (tractor.getHp()<50||tractor.getHp()>1100) return false; else
               if (tractor.getIsRare()==false) return false; else
               if (tractor.getYearsInService()<1||tractor.getYearsInService()>200) return false; else
               if (tractor.getYearOfManufacture()<1800||tractor.getYearOfManufacture()>2008) return false; else
               if (tractor.getValue()<100||tractor.getValue()>1500) return false; else
               if (tractor.getLastWorkPlace()==null) return false; else
          return true;
     public JPanel getMenuButtons() {
          return MenuButtons;
     public JButton getListall() {
          return listall;
     public JLabel getCompanyname() {
          return companyname;
     public JButton getExitsystem() {
          return jButton3;
     public JButton getSearchmanufacturer() {
          return searchmanufacturer;
     public JButton getListallexbited() {
          return listallexbited;
     public JButton getAddtractor() {
          return addtractor;
     public JButton getDeletetractor() {
          return deletetractor;
     public JButton getExhibittractor() {
          return exhibittractor;
     public JButton getArchivetractor() {
          return archivetractor;
     public JTextArea getOutputscreenx() {
          return outputscreen;
public void savetractors () {
     try {
          XMLEncoder encoder = new XMLEncoder(new FileOutputStream("tractor.xml"));
          encoder.writeObject(tractors);
          encoder.close();
     } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
public void loadtractors () {
try {
          XMLDecoder decoder = new XMLDecoder(new FileInputStream("tractor.xml"));
          tractors = (Tractor[]) decoder.readObject();
          decoder.close();
          for (int i=0; i<tractors.length;i++) {
               if (tractors!=null)numberOfTractors =i;
          numberOfTractors++;
     } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          tractors=new Tractor[25];
          numberOfTractors=0;

here's an example:
http://jdj.sys-con.com/read/37550.htm
you need to have a class Tractor with all those properties and then use readObject.Somehow you need to tell the Encoder/Decoder what Tractor means..
hope this helps!!

Similar Messages

  • Help with Packages and xml files

    I have a XML file that is read by the program that I want to add to my package.
    The package can be check out with a different name and different location each time, so how would I set up for my file to be read in by com.compname.project.lib.xml enstead of c:/dev/com/compname/project/lib.xml

            InputStream fis = null;
            BufferedInputStream bis = null;
            DataInputStream dis = null;
            String[] original = new String[3];
            //try {
                fis = this.getClass().getResourceAsStream("/c.s.p.b.i.t.c.c.xml");
                xmlpath = new File(is.toString());
                bis = new BufferedInputStream(xmlpath);
                dis = new DataInputStream(bis);
            //catch (FileNotFoundException e) {}
            try
                //parse the file
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                Document doc = db.parse(fis);
                doc.getDocumentElement().normalize();
                NodeList nodeLst = doc.getElementsByTagName(Tag)Edited by: mferguson13 on Jan 28, 2009 6:58 AM

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • How to display an XMl file in a webydynpro Application.

    Hi All,
    I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start this application
              Thanks in advance
    Regards
    ravi

    HI Ravi,
    Insert a portalIFRame or IFrame with width 100%.
    Create a context variable (Say xmlFile) of type String and bind to Source property of PoratlIFrame .
    Put the xmlfile inside Project\src\mimes\Components\Package\
    Let the xml file name be Config1.xml.
    Write the following code inside wdDoinit()
    wdContext.currentContextElement().setPortalFrame(WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Config1.xml"));
    Regards
    Fahad Hamsa

  • Again: display large XML fil;e?

    Dear all,
    Any ideas to display large XML file into a JTree? This has been asked before, but still does not have any solution yet.
    I am looking for your kind help. Please help show me some codes, if you know.
    Many thanks!

    Any (close) examples for it? i've not got any - sorry
    btw, how large is large? does this mean you can't afford to store the whole XML in memory at the same time, or simply that the gui is unresponsive/resource hungry?
    asjf

  • Basic question, how to create rtf template with a given xml file

    Hello guys
    I am new to BI publisher and I am learning how to create rtf templates using given xml fiel definitions by following the bi publisher guide
    The steps I am following is:
    1, create template using template builders, which is downloaded into MS words.
    2, In the empty template, map the xml columns with template field using BI publisher tag
    3, upload the template to BI Publisher as a layout.
    That's all I can understand.
    My question is:
    1,in which above step do I import XML file into template builder (if not bi publisher), how to do so?
    2,After template is created, how to associate this template layout with existing reports in BI Publisher, or is it necessary at all?
    3,In the template content in MS Word template builder, what should I enter other than BI publisher tags for mapping XML field to desired template field
    Or, if my understand of this process is entirely wrong, what's the right process of creating rtf template with a given XML file definition
    Thanks

    If you have a BI Publisher desktop installed, have a look a the demos,.. should answer most of your basic questions.
    (Windows) Start->Programs->Oracle BI Publisher Desktop->Demos
    Invoice Demo - good one for those with E-Business Suite
    Report Demo - Sample using BI Publisher

  • Anybody know what's up with the menu.xml.files not being available for DW after installing on a new comp?

    Anybody know what's up with the menu.xml.files not being available for DW after installing on a new comp?

    Usually that error can be cleared up by renaming the personal config folder. Turn on your OS's hidden files and then go to...
    C: > Users > your username > AppData > Roaming > Dreamweaver (version) > your language > configuration
    Rename the configuration folder configuration-old and start DW up. That should create an entirely new configuration folder and correct the menu.xml file.

  • Help with converting a Nero file

    I have previously converted a dvd insert designed with Nero into a pdf using adobe acrobat in order to send to someone else.  When I tried to do the same thing today with a new Nero designed insert the conversion wouldn't work.  The message said adobe didn't support the program that created the file.  Any ideas?

    thanks for your response.
    When I create a dvd insert or cd label etc using Nero the file extension is nct - nero cover template.  The printer wants the file as a pdf as he can't open Nero files.  I have version 9.3 of acrobat.
    Date: Mon, 18 Jan 2010 21:43:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: help with converting a Nero file
    Nero is simply a CD/DVD burning application and should have no effect on the type of files that will eventually be on the CD/DVD.
    What type of files are you trying to convert and exactly how are you trying to convert them? Plus, it would help to know the version of Acrobat you are using.
    >

  • Problem with parsing large XML files chunked over HTTP

    I'm trying to isolate a bug that was introduced when upgrading the JRE in use from Java 7u51 to 7u71 without changing any code. The problem appears to be very similar to: Bug ID: JDK-8027359 XML parser returns incorrect parsing results.
    Further investigation showed that it was also introduced in the same versions (7u71) where that fix was applied. Unlike that bug though, my XML is marked as version 1.0. It also appears to be with only large XML files, on the order of 10MB or so.
    The closest I've been able to narrow it down to is the code is using JAXB to unmarshall a stream that the debugger tells me is a org.apache.http.com.EofSensorInputStream / org.apache.http.impl.io.ChunkedInputStream. The exception I get is not consistent, but typically appears to be from chunks being overwritten or shuffled, resulting in letters appearing in attributes that are actually numbers, or like the following where an attribute "testAttribute" gets partially overwritten by the end of a timestamp that was in a different section of the XML.
    javax.xml.bind.UnmarshalException
    - with linked exception:
    [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,98748]
    Message: Attribute name "testAttribu00Z" associated with an element type "testElement" must be followed by the ' = ' character.]
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:421)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:357)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:334)
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,98748]
    Message: Attribute name "testAttribu00Z" associated with an element type "testElement" must be followed by the ' = ' character.
      at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:355)
      ... 6 more
    Here's some code that seems to reproduce it if you can connect to an XML server that returns a large chunked XML file:
      SchemeRegistry registry = new SchemeRegistry();
      registry.register(
                    new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
      HttpClient client = new DefaultHttpClient(new BasicClientConnectionManager(registry));
      String url = "http://someUrlReturningAlargeChunkedXML";
      HttpGet method = new HttpGet(url);
      HttpResponse response = client.execute(method);
      InputStream inputStream = response.getEntity().getContent();
      XMLStreamReader responseReader = factory.createXMLStreamReader(inputStream);
      JAXBElement<JaxBObjectOfResponse> wot = unmarshaller.unmarshal(responseReader, JaxBObjectOfResponse.class);
    If you connect using URL.openStream() to the same service there is no error. If I read bytes directly and write to a file, there is no error. The error only happens when I try to unmarshal it, and it's large, and I'm using Java 7u71 (or later). It can be consistently repeated with the jsp webapp that I'm using, but didn't show the error when I used the same code with a Wikipedia dump XML file.
    How can I unmarshal in a different way to avoid this problem? Or, how can I better isolate the bug so it can be posted to the appropriate bug system?

    Apparently, adding the Woodstox XML libraries avoids the bug. Is there anyone who can reproduce this on another system? Was there any changes to the Stax implementation between u67 and u71 that may have introduced a bug like this?
    Edit: When setting the logging level to DEBUG, I once saw the overwritten buffer being logged as if that was what was received (as in the testAttribu00Z example above). I can't repeat that anymore though, and very rarely it does parses with no exception (though it may have still been corrupted). Now the error seems to be consistently on one of the buffer boundaries, as in:
    17:08:09,705 DEBUG wire:63 - << "2000[\r][\n]"
    17:08:09,705 DEBUG wire:77 - << "trend>....OTHER XML...<trend hours=""
    17:08:09,705 DEBUG wire:77 - << "634.0972777777778" datetime="2013-05-21T00:43:48.350Z" t"
    17:08:09,705 DEBUG wire:63 - << "[\r][\n]"
    17:08:09,705 DEBUG wire:63 - << "2000[\r][\n]"
    17:08:09,705 DEBUG wire:77 - << "rend-mode="0">
    Exception in thread "main" java.lang.NumberFormatException: t34.0972777777778
      at com.sun.xml.internal.bind.DatatypeConverterImpl._parseDouble(DatatypeConverterImpl.java:213)
      at mypackage.Trend_JaxbXducedAccessor_hours.parse(TransducedAccessor_field_Double.java:48)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:194)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:486)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:465)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:60)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:231)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:165)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:355)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:334)
    Or:
    17:19:12,563 DEBUG wire:63 - << "2000[\r][\n]"
    17:19:12,563 DEBUG wire:77 - << ...OTHER XML...<trend index="5"
    17:19:12,563 DEBUG wire:77 - << "" label="N"
    17:19:12,563 DEBUG wire:63 - << "[\r][\n]"
    Exception in thread "main" java.lang.NumberFormatException: Not a number: N
      at com.sun.xml.internal.bind.DatatypeConverterImpl._parseInt(DatatypeConverterImpl.java:106)
      at com.sun.xml.internal.bind.DatatypeConverterImpl._parseShort(DatatypeConverterImpl.java:118)

  • XML files imported into SPRC are not properly loading associated data into SPRC

    Hi EHS Gurus,
    My Issue is - XML files imported into SPRC are not properly loading associated data into SPRC .
    When am uploading the XML files manually its working fine in /TDAG/CPM00.
    The same when we are uploading the XML files thru basis program IPC (XML) Documents into SAP , its not working .In XMl file it showing its complaint the same time compliance workbench complaint statues it showing empty .
    for you reference pls see the attached screenshot .
    Pls can you help me on this .
    Regards,
    Suresh.

    Hi EHS Gurus,
    My Issue is - XML files imported into SPRC are not properly loading associated data into SPRC .
    When am uploading the XML files manually its working fine in /TDAG/CPM00.
    The same when we are uploading the XML files thru basis program IPC (XML) Documents into SAP , its not working .In XMl file it showing its complaint the same time compliance workbench complaint statues it showing empty .
    for you reference pls see the attached screenshot .
    Pls can you help me on this .
    Regards,
    Suresh.

  • I want to drag and drop a file to a JText area with its file icon

    I want to drag and drop a file to a JText area with its file icon , but the problem is I cant show the file icon.
    Anyone knows this.
    this is my code.
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.Transferable;
    import java.awt.dnd.DnDConstants;
    import java.awt.dnd.DropTarget;
    import java.awt.dnd.DropTargetDragEvent;
    import java.awt.dnd.DropTargetDropEvent;
    import java.awt.dnd.DropTargetEvent;
    import java.awt.dnd.DropTargetListener;
    import java.io.File;
    import javax.swing.*;
    import javax.swing.filechooser.FileSystemView;
    public class FileDrag extends JFrame implements DropTargetListener {
    DropTarget dt;
    File file;
    JTextArea ta;
    JLabel lbl;
    Graphics g;
    ImageIcon tmpIcon;
    public FileDrag() {
    super("Drop Test");
    setSize(300, 300);
    getContentPane().add(
    new JLabel("Drop a list from your file chooser here:"),
    BorderLayout.NORTH);
    ta = new JTextArea();
    ta.setBackground(Color.white);
    getContentPane().add(ta);
    dt = new DropTarget(ta, this);
    setVisible(true);
    public void dragEnter(DropTargetDragEvent dtde) {
    System.out.println("Drag Enter");
    public void dragExit(DropTargetEvent dte) {
    System.out.println("Source: " + dte.getSource());
    System.out.println("Drag Exit");
    public void dragOver(DropTargetDragEvent dtde) {
    System.out.println("Drag Over");
    public void dropActionChanged(DropTargetDragEvent dtde) {
    System.out.println("Drop Action Changed");
    public void drop(DropTargetDropEvent dtde) {
    FileSystemView view = FileSystemView.getFileSystemView();
    JLabel testb;
    Icon icon = null;
    Toolkit tk;
    Dimension dim;
    BufferedImage buff = null;
    try {
    Transferable tr = dtde.getTransferable();
    DataFlavor[] flavors = tr.getTransferDataFlavors();
    for (int i = 0; i < flavors.length; i++) {
    System.out.println("Possible flavor: " + flavors.getMimeType());
    if (flavors.isFlavorJavaFileListType()) {
    dtde.acceptDrop(DnDConstants.ACTION_COPY);
    ta.setText("Successful file list drop.\n\n");
    java.util.List list = (java.util.List) tr.getTransferData(flavors);
    for (int j = 0; j < list.size(); j++) {
    System.out.println(list.get(j));
    file = (File) list.get(j);
    icon = view.getSystemIcon(file);
    ta.append(list.get(j) + "\n");
    ta.append("\n");
    tk = Toolkit.getDefaultToolkit();
    dim = tk.getBestCursorSize(icon.getIconWidth(), icon.getIconHeight());
    buff = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_ARGB);
    icon.paintIcon(ta, buff.getGraphics(), 10, 10);
    repaint();
    dtde.dropComplete(true);
    return;
    System.out.println("Drop failed: " + dtde);
    dtde.rejectDrop();
    } catch (Exception e) {
    e.printStackTrace();
    dtde.rejectDrop();
    public static void main(String args[]) {
    new FileDrag();
    }

    This appears to be a long-standing bug:
    https://bugzilla.mozilla.org/show_bug.cgi?id=634720
    and the accepted workaround is stated in comment 11.
    Oddly, it's possible to do the reverse, i.e. drag multiple eml files from Explorer to a TB folder.

  • Display an XML file Content as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013

    Hello everyone,
    Within a list form, user has to select a value amongst a huge number of availables options.
    Instead of using something like a dropdown list, which would be very boring to parse, I would like to display possibles values in a treeview.
    To do that, I tried to use an <Sharepoint:SPTreeView bind to a SharePoint:SPXmlDataSource who read data from an XML File.
    <SharePoint:SPXmlDataSource runat="server" DataFile="../../SiteAssets/App_Data/myfile.xml" AutoSave="True" XPath="" ID="myDataXml"></SharePoint:SPXmlDataSource>
    <SharePoint:SPTreeView runat="server" ID="MyTreeView" DataSourceID="myDataXml" />
    But when I try to display the form in my web browser, an error occurs.
    Therefore, my question is : Is it possible to display the content of an Xml file as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013 ?
    If the answer is yes, how ? Which are the required properties for "SharePoint:SPXmlDataSource" tag and "SharePoint:SPTreeView"  tag ?
    What are the requirements to use thoses tags ?
    Regards,
    Florian.
    Ps : I dont have access to the server side of the SharePoint site I am working on.

    Assuming that https://fullsitename is a new URL address did you make sure to update your browser to include it in the Trusted Sites zone?  The message you are quoting is exactly the one you get if you don't have it in Trusted Sites.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Problems with parsing and display a XML-File

    Hi,
    I'm working on an applet to read a XML-file, display the content in a JTree, in order to modify and save it again. I found this tutorial: http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/index.html
    I took this example http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/work/DomEcho02.java and modified it, to run it as an applet.
    I changed the method main into:
    public class EditorTest extends JApplet {
    public void init(){
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         try {
              DocumentBuilder builder = factory.newDocumentBuilder();
              File file = new File("/path/inhalt.xml");
              document = builder.parse(file);
         } catch (SAXException sxe) {
              // Error generated during parsing)
              Exception     x = sxe;
              if (sxe.getException() != null)
                   x = sxe.getException();
              x.printStackTrace();
         catch (ParserConfigurationException pce) {
              // Parser with specified options can't be built
              pce.printStackTrace();
         } catch (IOException ioe) {
              // I/O error
              ioe.printStackTrace();
         makeWindow(); //equals makeFrame(); in the tutorial
    } //initThe method makeWindow() looks like this:
    private Container container;
    private void makeWindow(){
         container = getContentPane();
         JDesktopPane desktop = new JDesktopPane();
         final EditorTest echoPanel = new EditorTest();
         JMenuBar menuBar = MakeMenuBar();  //returns a JMenuBar with a few items in it
         container.add(menuBar, BorderLayout.NORTH);
    }The constructor:
    public DomEcho02() {
         // Set up the tree
         JTree tree = new JTree(new DomToTreeModelAdapter());
         // Build left-side view
         JScrollPane treeView = new JScrollPane(tree);
         treeView.setPreferredSize( new Dimension( leftWidth, windowHeight ));
         // Build right-side view
         final JEditorPane htmlPane = new JEditorPane("text/html","");
         htmlPane.setEditable(true);
         JScrollPane htmlView = new JScrollPane(htmlPane);
         htmlView.setPreferredSize(new Dimension( rightWidth, windowHeight ));
         // Build split-pane view
         JSplitPane splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, treeView, htmlView );
         splitPane.setContinuousLayout( true );
         splitPane.setDividerLocation( leftWidth );
         splitPane.setPreferredSize( new Dimension( windowWidth + 10, windowHeight+10 ));
         // Add GUI components
         this.setLayout(new BorderLayout());
         this.add("Center", splitPane );
    } // ConstructorI didn't change the class AdapterNode and DomToTreeModelAdapter. When I change the line "JTree tree = new JTree(new DomToTreeModelAdapter());" into "JTree tree = new JTree();", the applet starts and display a standard-JTree, as it ist generated by the constructor. If I want to display my own Tree the applet fails. When I start it with the appletviewer I get this message:
    java.lang.NullPointerException
    at DomEcho02$AdapterNode.childCount(DomEcho02.java:151)
    at DomEcho02$DomToTreeModelAdapter.isLeaf(DomEcho02.java:167)
    at javax.swing.JTree.setModel(JTree.java:704)
    at javax.swing.JTree.<init>(JTree.java:511)
    at DomEcho02.<init>(DomEcho02.java:51)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
    at sun.applet.AppletPanel.run(AppletPanel.java:324)
    at java.lang.Thread.run(Thread.java:595)
    Is there anyone out there, who knows how to fix it?
    Thanks in advance.

    I found out, how it was going wrong.
    When the applet started, it didn't start with the method init(), as it should do, it started with the constructor. Because there was no document the method childCount() throws a exception. After this, the method init() startet reading the file and started the constructor again, but the results were not shown.
    After knowing this I decided to write the Applet again and now it's working fine.

  • Attributes...Help with displaying File Type Icons

    I have a document area folder(s) that content managers can
    upload files into. I know that they can place an image with
    these files by using the secondary tab, BUT, my question is
    this....
    Is there a way to have the portal identify what type of file
    this is and associate an image to it to display just like
    the "NEW" icon does....ie....when they load a word document, the
    word icon will be displayed next to the title.
    This would get rid of having to upload the image with every file
    (Which there are many) and save space within the database as
    these images are stored with in each record.
    Please let me know if this is possible and if anyone has any
    suggestions.
    PS...running 308 at this time.

    OK...I figured it out a couple different ways.
    First way I did it was to create perspectives for each file type
    ie word, excel Power Point etc. You can then just add the
    perspective when adding files to the document area.
    BUT, this also isn't automated and can be if you want to.
    Simply write a trigger(s) to do this for you. Wrote one this
    afternoon and it work flawlessly. Now when users add a file to
    the document area, a nice little ICON displays next to the file
    name.
    If anyone else has a different more efficient way, please pass
    it on.
    Thanks

  • Using jnet/jgantt with a generated XML file

    Hello,
    We want to display a gantt in a BSP page. For that we decided to use the JGantt object (from the graphics bsp extension, using the graphics:net tag).
    From the documentation and examples I saw that to the information is displayed from an XML file in the MIME repository. I wanted to know if it's possible to instead give the XML string as a parameter to the graphics:net object somehow (since it's generated during runtime so I don't have a physical file in the repository). If not, maybe it's possible to create the XML file on the server and receive the URL (it should be a different URL each time because the data might be different).
    I couldn't find any documentation for the properties of the graphics:net tag - maybe the answer is in there (I saw there's an attribute called use_local_mime_repository - what does it mean?).
    Also, if you have other suggestions for showing a gantt it might also be helpful.
    Thanks in advance.

    Hello Udi,
    If you need to pass the whole XML file to an abap variable, you can do it with the help of Ajax.
    You can get back all the contents of a page into a javascript variable and then you will have to assign to a hidden field.
    Then on a button click or any other event you can assign this value to the abap variable and use it where ever needed.
    For learning Ajax in BSP you can refer my blog
    /people/shashank.kapoor/blog/2009/03/09/ajax-in-bsp
    I hope this helps.
    Regards,
    Shashank

Maybe you are looking for

  • How can i upgrade to iPhoto 9.5?

    Hello everybody, I have the 9.43 version on OS  Mavericks on an iMac, but there is no indication of an update to the 9.5 version in the App Store. I just could buy the new 9.5 version. Do You habe an advise for me? Thank You very much.

  • Developer roles in PI 7.3 Java only stack

    Hi All, Can anybody help me to findout what are the standard roles a Pi developer would need in Java stack? What are the generic roles available? What are the display only roles? How to know what roles we need to give when we create a user in PI java

  • PSD files get destroyed

    Hi, I'm using Aperture 2.1.2 for only a few days now, and Photoshop CS4. When I bought Aperture, it said that it was able to handle PSD files. Now, here's my problem: 1. I drag (or import, no difference) a PSD file (made with Photoshop CS3) with all

  • Default File Selection while Running Data Manager Package

    Hi BPC Experts, What i wanted to know is that is possible to make a file selection as "Default" for running a data manager package.Say for example i wanted to run a simple DMP "Load Transaction data from from BW InfoProvider UI" and the file that i a

  • Transpose of columns to rows (unpivoting) and not rows to columns

    Hi, I am right now using oracle 10g. I HAVE the following specification. Here I specified only 5 columns. We have upto 200 columns. TRANS_ID      PORTFILIO_NUM     TICKER          PRICE     NUM_SHARES ........................................ 2     10