Xml in japplet

Hi,
I want to create a tree(with using jtree class) by getting datas from the xml in japplet with expand and collapse event..can anyone give some suggestion,how to proceed?

Cross-posted.

Similar Messages

  • XML file with an attached MIME encoded ZIP file

    Hi all,
    I'm new to SAP WAS and MIME encoding/decoding, and I'm trying to generate an XML file with an attachment which is also MIME encoded.
    1) I have dummy files (1.jpg, 2.jpg) and I'm trying to zip these files into one zip file (files.zip).
    2) I'm trying to MIME encode/decode this zip file.
    3) I'm trying to attach this MIME encoded zip file to existing XML file.
    Which FMs could I use to accomplish this?  Your help is very appreciated.
    Thank you.
    below is a file example that I'm trying to generate.
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
         boundary="--XXXXboundary text"
    Content-Transfer-Encoding: 7bit
    This is a multi-part message in MIME format.
    --XXXXboundary text
    Content-Type: text/xml;
         charset="utf-8"
    Content-Transfer-Encoding: 8bit
    <?xml version="1.0" encoding="utf-8"?>
    <abc/>
    <def/>
    --XXXXboundary text
    Content-Type: application/octet-stream;       name="files.zip"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment
    UEsDBBQAAAAIAI9EejAs5k34H84DAAYgBAAMAAAAMDAyMjQ5MTEucGRmnLsJWBNJ2zb6jmJIIIFE
    BAMIJGEVBSKGRRAhEGQNoGwKYoiAEnYRUFGIkBAQFzYXRNHAAEGQZRy2ATFDUAHfGScSIUwQMMrM
    ECGADptA0n/jzLtc//dd51znVAKdru6uqn7q6fu5764qQz

    Just create an applet (extend JApplet)... add a JTextArea to it....fill the text area with the text from an XML doc.
    To get the text of the XML doc just do something like..
    File xmlFile = new File("<path to xml file>");
    FileInputStream fis = new FileInputStream(xmlFile);
    byte[] bytes = new byte[(int) xmlFile.length()];
    fis.read(bytes);
    fis.close();
    String xmlText = new String(xmlBytes);
    textArea.setText(xmlText);
    ...try something like that (assuming..i understand what it is u want)

  • JApplet JDOMException

    Hi all,
    I created a JApplet with Netbeans 5.0. The Applet reads a XML file using JDOM. The applet runs fine within the AppletViewer but when I try to run the applet in a browser the java console gives me a java.lang.NoClassDefFoundError: org/jdom/JDOMException. I exported everything correctly into my program. Is this now a Netbeans problem or did I do something wrong programming the applet? Is the JDOM.jar maybe not included in my build? How can I do this?
    Cheers Alex

    So are you saying that if I don't define start()
    method by overriding or overloading the browser's
    start() method, then the browser's start() method
    places the applet thread into ready state even though
    I don't have any other threads?No. I say if you do not redefine start() and stop(), that doesn't mean that they're not defined. They are in fact implemented (though they are empty), and the browser calls them. Depending on what your applet does, it won't need to explicitely start something in it's start() method, it will run anyway, like calculator applet for example.
    BTW, how do I find the declarations and definitions of
    the browser's key methods?I'm not sure about what you mean by "browser's key methods". You shouldn't need to care to much about what the browser does...

  • All is fine with JFrame, but the same code doesn't work in JApplet?

    I try to manage XML files using Xerces-perser,
    and all is ok if I work with JFrame,
    but when I try to do the same thing in JApplet,
    I get ClassDefNotFound error at the initializing
    of applet. It writes that the problem is with
    Xerces-classes (org.w3c.dom.Node f.e.),
    it seems to me that "appletviewer" (1.3.01) which
    I use to launch JApplet doesn't see these classes,
    while "java" does when I do the same with JFrame.
    May be, do you have some ideas?

    add "crimson.jar" and "jaxp.jar" in your archive list in your html, which lunch your applet.

  • JApplet performace

    Hi,
    I have developed a JApplet which connects to the data base and loads data and also has a lot of XML and XSLT in it, for proper working of this applet it requires a lot of jar files, like one jar file is of JDBC driverm then jar files required for XPath and XML parser, and the jar file of the classes which i have develpoed, now the problem is it takes a lot of time to load as it downloads all the jar files on the client machine,
    so how can i imporve the performace of my applet. is there a way i can work around without downloading all the jar files on the client machine,
    Ashish

    The XML parser and other stuff might be in a later version of Java (1.4 has the XML and XSLT, I know that much.)
    Also, you could make an installer to install extensions onto the client machine so you don't have to load them from the server every time.

  • GUI files - using japplet.setGUI() security risk

    All,
    In Javascript when you use the .setGui() function to change the gui file used it seems to look in the configured location for the client files and this in turn gives a java security warning.
    Warning is about signed and unsigned code.
    I have the client files under IIS in the typical jVue folder.
    GUI file is named: CCReadOnly.gui
    If I remove all .gui files from C:\inetpub\wwwroot\jVue the message does not appear. When I first open a document this is fine. Then if I load another document using .setFile() we have this problem because it looks in the CODEBASE location.
    So this is why we put a copy of the .gui files from C:\Oracle\AutoVue\bin\Profiles into C:\inetpub\wwwroot\jVue so it can download and use the .gui file. This then gives the security issue.
    We close the first document first then call setGui() then load the next document.
    So:
    japplet.closeDocument();
    japplet.setGUI('CCReadOnly');
    japplet.setFile('***');
    How do we make the applet use the .gui files in the /Profiles directory?

    In my system, I only use the gui file on the /Profile folder. It appears to behave better than placing it as a resource for me. But if I have some time, I will move it there so I can package properly the whole solution, with no need to touch the server every time i change the gui file.
    As for the signed / unsigned code warning, I had such an issue around that time of development, but it was not due to the gui file. It may be not your issue, but since it happened to me around the same time and with the same result, I'll detail it in case it is this thing. I had my applet extend jvue, and then packed as a jar to call from a jsp file in another project - we develop the applet and the environment separately -. That packed jar contained signed code (jvue.jar) and unsigned code (my code), and raised the alert. The solution was to use a signer plugin during the package process. I use maven, so in the pom.xml I added:
    +     <build>+
    +          <plugins>+
    +               <plugin>+
    +                    <groupId>org.apache.maven.plugins</groupId>+
    +                    <artifactId>maven-jarsigner-plugin</artifactId>+
    +                    <version>1.2</version>+
    +                    <executions>+
    +                         <execution>+
    +                              <id>sign</id>+
    +                              <goals>+
    +                                   <goal>sign</goal>+
    +                              </goals>+
    +                         </execution>+
    +                         <execution>+
    +                              <id>verify</id>+
    +                              <goals>+
    +                                   <goal>verify</goal>+
    +                              </goals>+
    +                         </execution>+
    +                    </executions>+
    +                    <configuration>+
    +                         <keystore>${project.build.outputDirectory}\.keystore</keystore>+
    +                         <alias>name</alias>+
    +                         <storepass>pass1</storepass>+
    +                         <keypass>pass2</keypass>+
    +                    </configuration>+
    +               </plugin>               +
    +          </plugins>+
    +     </build>+
    Once this newly packed jar was put in the deploy project, the browser asked for a certificate (my own one) and never again gave any 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.

  • XML Quote report

    We have a problem with our XML Quote report that cuts off the report at 26 pages when it should go to about 200 pages.
    We have another report the Acknowledge Quote and it works fine.

    Finally we found the solution for this problem.
    1. Open qotSCocPrint.jsp and add below line inside <SELECT id="qotOutFrmt" name="qotOutFrmt"> statement. This line should be added after "for" loop.
    <OPTION value="EXCEL">Excel Format</option>
    We can add as many options the XML Publisher supports.
    2. Decompile oracle.apps.aso.print.webui.MainCO.class (Controller).
    Change the below line
    httpservletresponse.setContentType("application/pdf");
    to
    httpservletresponse.setContentType("application/"+quoteOutputFormat.toLowerCase());
    Take a backup of the original file, compile the java in the same directory.
    3. Decompile oracle.apps.aso.print.server.PrintQuoteAMImpl.class and change this line
    Field field = class2.getDeclaredField("OUTPUT_TYPE_PDF");
    to
    String outputFormat="OUTPUT_TYPE"+as[12].trim();
    Field field = class2.getDeclaredField(outputFormat);
    Bounce Apache and generate the Quote output in desired format.

  • Issue in Creation of XML file from ABAP data

    Hi,
    I need to create a XML file, but am not facing some issues in creation of XML file, the in the required format.
    The required format is
    -<Header1 1st field= u201CValueu201D 2nd field= u201CValueu201D>
       - <Header2 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 10 fields>
              <Header3 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
              <Header4  1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 4 fields/.>
               <Header5 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
          </Header2>
       </Header1>
    Iu2019m using the call transformation to convert ABAP data to XML file.
    So please anybody can help how to define XML structure in transaction XSLT_TOOL.
    And one more thing, here I need to put the condition to display the Header 3, Header 4, Header 5 values. If there is no record for a particular line item in header 3, 4 & 5, I donu2019t want to display full line items; this is only for Header 3, 4 & 5.
    Please help me in this to get it resolved.

    Hello,
    you can use CALL TRANSFORMATION id, which will create a exact "print" of the ABAP data into the XML.
    If you need to change the structure of XML, you can alter your ABAP structure to match the requirements.
    Of course you can create your own XSLT but that is not that easy to describe and nobody will do that for you around here. If you would like to start with XSLT, you´d better start the search.
    Regards Otto

  • Rendering xml-table into logical filename in SAP R/3

    Hi,
    I am trying to translate an xml-table with bytes into a logical filepath in SAP R3.
    Do I have to use the method gui-download or shall I loop the internal xml-table?
    When I tried to loop the xml-table into a structure, and then transfering the structure into the logical filename, I get problems with the line breaks in my xml-file. How do I get the lines to break exactly the same as I wrote them in my ABAP-code?
    Edited by: Kristina Hellberg on Jan 10, 2008 4:24 PM

    I believe you posted in the wrong forum.
    This forum is dedicated to development and deployment of .Net applications that connect and interact with BusinessObjects Enterprise, BusinessObjects Edge, or Crystal Reports Server. This includes the development of applications using the BusinessObjects Enterprise, Report Application Server, Report Engine, and Web Services SDKs.
    Ludek

  • Momento de envio do XML

    Boa tarde,
    Estou em um projeto de implementação e com a seguinte dúvida:
    Requerimentos:
    Tenho que enviar o XML assim que a Invoice+NF é gerada (VF01/VF04, etc).
    Num segundo momento, após a aprovação do XML, eu poderei imprimir a DANFe.
    Envio XML:
    Sei que a função que mapeia o XML para a versão 2.0 é a J_1B_NF_MAP_TO_XML e a função que envia para o GRC ou outra mensageria (utilizaremos NeoGrid) é a J_1B_NFE_XML_OUT.
    A pergunta é: como faço a chamada destas funções? Qual programa devo chamar? Em qual momento? É por customizing ou por uma exit no faturamento?
    Obs.: entendo que estas funções já estão configuradas no monitor J1BNFE para solicitar o reenvio da nota, etc.
    Impressão DANFe:
    Em paralelo, na J1BJ vou ter que configurar somente o programa de impressão do DANFe (J_1BNFPR), correto? Pois assim quando eu gerar e processar o output da NAST ele irá fazer a impressão do documento, correto?
    Caso não entendam as perguntas por favor me contestem que eu explico melhor.
    Obrigado!
    Felipe Brasil Simioni

    Olá, Fernando.
    Por favor veja se pode nos ajudar.
    Estamos tendo o mesmo problema com o envio do XML para a mensageria (não GRC).
    Seguindo as parametrizações indicadas acima:
    SPRO
       Componentes válidos para várias aplicações
         Funções gerais de aplicação
           Nota Fiscal
             Saída
               Atribuir parametros de numeração e dxed impressão
    O local de negócios está configurado como RFC CALL vazio (segue descrição abaixo):
    "Execução RFC e atualização banco dados na mesma LUW (padrão)"
    Porém, ao tentar enviar a nota fiscal (ex: J1B1N), ocorre um erro na SM58 e o XML não é enviado para o sistema de mensageria.
    Analisando o programa SAPLJ_1B_NFE, no include LJ_1B_NFEF42, vemos que para mensagerias não GRC o programa chama a função J_1B_NFE_XML_OUT em background task, o que ocasiona o erro abaixo na SM58.
      IF sy-subrc IS INITIAL.
    non SAP messaging system                          "V1.10
        if lv_xnfeactive is initial.                    "V1.10
    Call function asych. when RFC connection available
    gv_callmode can be switched in debbuging to call the RFC synchronous
    do not reset gv_callmode direct after the RFC call
          if gv_callmode is initial.
            CALL FUNCTION 'J_1B_NFE_XML_OUT'
    IN BACKGROUND TASK
              DESTINATION lv_rfcdest
              EXPORTING
                xml_in                = xmlh
                xml_item_tab          = xmli_tab
                xml_batch             = xmlb_tab
                xml_ref               = xmlr_tab
                xml_dup               = xmld_tab
                xml_vol               = xmlv_tab
                xml_head_tab          = xmlh_tab          "V1.10
                xml_imp               = xml_import_tab    "V1.10
                xml_ext1              = xml_ext1_tab      "V1.10
                xml_ext2              = xml_ext2_tab      "V1.10
                xml_adi               = xml_adi_tab       "V2.00
                xml_reb               = xml_reb_tab       "V2.00
                xml_cane_dia          = xml_cane_dia_tab  "V2.00
                xml_cane_ded          = xml_cane_ded_tab. "V2.00
    Erro da SM58:
          RfcAbort: Cannot lock transaction
          Nº mensagem SR053
    Note que a chamada é feita de forma assincrona porque a variável gv_callmode está como initial, e que segundo o comentário da SAP, essa variável é usada somente para debug, sem qualquer parametrização que controle o modo de chamada.
    Obs: se comentarmos a linha IN BACKGROUND TASK, tudo funciona perfeitamente.
    Mas obviamente não é o que queremos fazer. Queremos manter o programa original da SAP.
    Já pesquisamos notas para esse problema, mas não encontramos nada que se refira a esse problema.
    Alguém mais se deparou com essa situação?
    Desde já agradeço pela ajuda.
    Rodrigo Ferreira

  • Generate prov.xml for Creative Cloud. Return Code 27

    We're trying to follow this guide (Creative Cloud Help | Using Adobe Provisioning Toolkit Enterprise Edition) to serialize a package (or something). We're stuck on generating prov.xml. My best attempt at an entry is:
    C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\CCP\utilities\APTEE>adobe_prtk.exe --tool=VolumeSerialize --generate --serial=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx --regsuppress=ss --eulasuppress --locales=en_US --provfilepath=C:\Program Fil
    es (x86)\Common Files\Adobe\OOBE\PDApp\CCP
    It says half of this is optional, but I'm skeptical.
    Anyway, I'm getting return code 27. This indicates that it is unable to edit the prov.xml file specified. I didn't specify a prov.xml file, I'm trying to make one. The syntax I'm using differs from what I found on the page I linked, as that was giving me syntax errors. I lifted this off someone else's code. I've tried just about every variation I can think of. Any help would be appreciated.
    This is on Windows

    One of these links may help
    http://helpx.adobe.com/creative-cloud/packager.html
    http://forums.adobe.com/community/download_install_setup/creative_suite_enterprise_deploym ent

  • XML file to B1 Sales Quotaion

    hello,
    I am trying to insert a sales quotation in XML file format into SAP B1.
    In the message log i get an error : Value too long in property 'CardCode' of 'Document'
    every time i use an Item code or a card code containing Hebrew characters , i get garbage in the message:
    i defind the B1 sender system language to Hebrew and i don't see the reason for the problem.
    thanks, udi

    Hi Eddy,
    I only get the error message in hebrew.
    i tried a sales quotation where the customer code and item code were in english and it loaded succesfully.
    thanks, udi

  • Need to convert JApplet to JFrame

    I need to write code for where I have 60 balls bouncing around inside a window. The client will then be able to select a button and it will pull out a ball with the number 1-60 written on it. The user will be able to do this up to 7 times. Each time it is done the past numbers that have already appeared can not reappear. What I am stuck on right now is geting my balls into a JFrame. Can anyone give advice or show how to. I currently have my 60 balls running in a JApplet. Here is the JAVA code and the HTML code. Thanks!
    Here is the JAVA code
    import java.awt.*;
    import java.applet.*;
    import java.util.*;
    import javax.swing.*;
    class CollideBall{
    int width, height;
    public static final int diameter=20;
    //coordinates and value of increment
    double x, y, xinc, yinc, coll_x, coll_y;
    boolean collide;
    Color color;
    Graphics g;
    Rectangle r;
    //the constructor
    public CollideBall(int w, int h, int x, int y, double xinc, double yinc, Color c){
    width=w;
    height=h;
    this.x=x;
    this.y=y;
    this.xinc=xinc;
    this.yinc=yinc;
    color=c;
    r=new Rectangle(150,80,130,90);
    public double getCenterX() {return x+diameter/2;}
    public double getCenterY() {return y+diameter/2;}
    public void alterRect(int x, int y, int w, int h){
    r.setLocation(x,y);
    r.setSize(w,h);
    public void move(){
    if (collide){  
    double xvect=coll_x-getCenterX();
    double yvect=coll_y-getCenterY();
    if((xinc>0 && xvect>0) || (xinc<0 && xvect<0))
    xinc=-xinc;
    if((yinc>0 && yvect>0) || (yinc<0 && yvect<0))
    yinc=-yinc;
    collide=false;
    x+=xinc;
    y+=yinc;
    //when the ball bumps against a boundary, it bounces off
    if(x<6 || x>width-diameter){
    xinc=-xinc;
    x+=xinc;
    if(y<6 || y>height-diameter){
    yinc=-yinc;
    y+=yinc;
    //cast ball coordinates to integers
    int x=(int)this.x;
    int y=(int)this.y;
    //bounce off the obstacle
    //left border
    if(x>r.x-diameter&&x<r.x-diameter+7&&xinc>0&&y>r.y-diameter&&y<r.y+r.height){
    xinc=-xinc;
    x+=xinc;
    //right border
    if(x<r.x+r.width&&x>r.x+r.width-7&&xinc<0&&y>r.y-diameter&&y<r.y+r.height){
    xinc=-xinc;
    x+=xinc;
    //upper border
    if(y>r.y-diameter&&y<r.y-diameter+7&&yinc>0&&x>r.x-diameter&&x<r.x+r.width){
    yinc=-yinc;
    y+=yinc;
    //bottom border
    if(y<r.y+r.height&&y>r.y+r.height-7&&yinc<0&&x>r.x-diameter&&x<r.x+r.width){
    yinc=-yinc;
    y+=yinc;
    public void hit(CollideBall b){
    if(!collide){
    coll_x=b.getCenterX();
    coll_y=b.getCenterY();
    collide=true;
    public void paint(Graphics gr){
    g=gr;
    g.setColor(color);
    //the coordinates in fillOval have to be int, so we cast
    //explicitly from double to int
    g.fillOval((int)x,(int)y,diameter,diameter);
    g.setColor(Color.white);
    g.drawArc((int)x,(int)y,diameter,diameter,45,180);
    g.setColor(Color.darkGray);
    g.drawArc((int)x,(int)y,diameter,diameter,225,180);
    public class BouncingBalls extends Applet implements Runnable {
    Thread runner;
    Image Buffer;
    Graphics gBuffer;
    CollideBall ball[];
    //Obstacle o;
    //how many balls?
    static final int MAX=60;
    boolean intro=true,drag,shiftW,shiftN,shiftE,shiftS;
    boolean shiftNW,shiftSW,shiftNE,shiftSE;
    int xtemp,ytemp,startx,starty;
    int west, north, east, south;
    public void init() {  
    Buffer=createImage(getSize().width,getSize().height);
    gBuffer=Buffer.getGraphics();
    ball=new CollideBall[MAX];
    int w=getSize().width-5;
    int h=getSize().height-5;
    //our balls have different start coordinates, increment values
    //(speed, direction) and colors
    for (int i = 0;i<60;i++){
    ball=new CollideBall(w,h,50+i,20+i,1.5,2.0,Color.white);
    /* ball[1]=new CollideBall(w,h,60,210,2.0,-3.0,Color.red);
    ball[2]=new CollideBall(w,h,15,70,-2.0,-2.5,Color.pink);
    ball[3]=new CollideBall(w,h,150,30,-2.7,-2.0,Color.cyan);
    ball[4]=new CollideBall(w,h,210,30,2.2,-3.5,Color.magenta);
    ball[5]=new CollideBall(w,h,360,170,2.2,-1.5,Color.yellow);
    ball[6]=new CollideBall(w,h,210,180,-1.2,-2.5,Color.blue);
    ball[7]=new CollideBall(w,h,330,30,-2.2,-1.8,Color.green);
    ball[8]=new CollideBall(w,h,180,220,-2.2,-1.8,Color.black);
    ball[9]=new CollideBall(w,h,330,130,-2.2,-1.8,Color.gray);
    ball[10]=new CollideBall(w,h,330,10,-2.1,-2.0,Color.gray);
    ball[11]=new CollideBall(w,h,220,230,-1.2,-1.8,Color.gray);
    ball[12]=new CollideBall(w,h,230,60,-2.3,-2.5,Color.gray);
    ball[13]=new CollideBall(w,h,320,230,-2.2,-1.8,Color.gray);
    ball[14]=new CollideBall(w,h,130,300,-2.7,-3.0,Color.gray);
    ball[15]=new CollideBall(w,h,210,90,-2.0,-1.8,Color.gray);*/
    public void start(){
    if (runner == null) {
    runner = new Thread (this);
    runner.start();
    /* public void stop(){
    if (runner != null) {
    runner.stop();
    runner = null;
    public void run(){
    while(true) {
    Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
    try {runner.sleep(15);}
    catch (Exception e) { }
    //move our balls around
    for(int i=0;i<MAX;i++)
    ball[i].move();
    handleCollision();
    repaint();
    boolean collide(CollideBall b1, CollideBall b2){
    double wx=b1.getCenterX()-b2.getCenterX();
    double wy=b1.getCenterY()-b2.getCenterY();
    //we calculate the distance between the centers two
    //colliding balls (theorem of Pythagoras)
    double distance=Math.sqrt(wx*wx+wy*wy);
    if(distance<b1.diameter)
    return true;
    return false;
    private void handleCollision()
    //we iterate through all the balls, checking for collision
    for(int i=0;i<MAX;i++)
    for(int j=0;j<MAX;j++)
    if(i!=j)
    if(collide(ball[i], ball[j]))
    ball[i].hit(ball[j]);
    ball[j].hit(ball[i]);
    public void update(Graphics g)
    paint(g);
    public void paint(Graphics g)
    gBuffer.setColor(Color.lightGray);
    gBuffer.fillRect(0,0,getSize().width,getSize().height);
    gBuffer.draw3DRect(5,5,getSize().width-10,getSize().height-10,false);
    //paint our balls
    for(int i=0;i<MAX;i++)
    ball[i].paint(gBuffer);
    g.drawImage (Buffer,0,0, this);
    Here is the HTML code
    <html>
    <body bgcolor="gray">
    <br><br>
    <div align="center">
    <applet code="BouncingBalls.class" width="1000" height="650"></applet>
    </div>
    </body>
    </html>

    In the future, Swing related questions should be posted in the Swing forum.
    First you need to convert your custom painting. This is done by overriding the paintComponent() method of JComponent or JPanel. Read the Swing tutorial on [Custom Painting|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html].
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting.

  • Generate xml source file for Oracle Order Capture Print Quote

    Hi,
    I am new to xml and need to work on creating templates for Print Quote.
    I am trying to generate the xml source file for which I enabled the report in system administrator and set the output to XML and assigned to Quoting Reports responsiblity. I then assigned XML Report Publisher to the same responsiblity.
    I ran the report (Print Quote) and then I am trying to run the XML Report Publisher but I cannot get the request id in the list of values.
    I am able to generate xml source file for other reports like Printed Purchase Order etc.,
    The view output for the (Print Quote) report is as follows:
    <?xml version="1.0" ?>
    - <!-- Generated by Oracle Reports version 6.0.8.26.0
    -->
    <ASOPQTER />
    How do I get the xml source file? Or are there seeded templates that I can use to create more templates? Any help would be appreciated. Thanks Ravi

    Hi, I am in the same position - did this issue ever ger resolved by anyone. I have done a few XMLP reports successfully now using the Word add-in, but customising the Quote output differs from other standard reports.
    If you look at the data definition for Quote it is a 'dummy' definition and has no XML file attached. Does anyone know how I can get the XML format for the report output?
    Also the template uses XSL-FO ?!?!?! rather than RTF - not sure how to work with this, the Oracle docs are not very helpful in this regard either.
    Has anyone successfully managed to customise the Quote print report? Many thanks,
    Roger

Maybe you are looking for