Problem occurs due to combine the code.....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Navdip
    New Member
    • Mar 2008
    • 22

    #1

    Problem occurs due to combine the code.....

    Hi all..
    i am developing a project in java using swings and JApplets which has different modules for different purposes. in this project there is a module named "event" which has three button..and they have their well defined set of action.... Because project is very large so i had developd them separately ...and now they are working and gives proper output..but when i combined them with main project...it doesn't give any output although there is not any error.....so please know me how to tackle it..??
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Your question is like saying: I built a real fast car myself: the steering engine
    works, the wheels can rotate and I can even open and close the windows; the
    car just won't drive; what could be the problem?

    You should do some unit testing: the input for one module can be the output of
    another one; test that communication for all modules that do interact. Slowly
    build up the combination of your modules and test whether or not it functions
    properly; only then proceed to the next module(s) integration.

    kind regards,

    Jos

    Comment

    • Navdip
      New Member
      • Mar 2008
      • 22

      #3
      Originally posted by JosAH
      Your question is like saying: I built a real fast car myself: the steering engine
      works, the wheels can rotate and I can even open and close the windows; the
      car just won't drive; what could be the problem?

      You should do some unit testing: the input for one module can be the output of
      another one; test that communication for all modules that do interact. Slowly
      build up the combination of your modules and test whether or not it functions
      properly; only then proceed to the next module(s) integration.

      kind regards,

      Jos
      Hi josah
      there is no IPC in project so no module can interact with another module...i have put some print statements to debug it but they do not execute after ocurance of following statements..
      JFileChooser filechooser=nul l;
      filechooser = new JFileChooser();
      i.e control doesn't move after these statements.....

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Navdip
        Hi josah
        there is no IPC in project so no module can interact with another module...i have put some print statements to debug it but they do not execute after ocurance of following statements..
        JFileChooser filechooser=nul l;
        filechooser = new JFileChooser();
        i.e control doesn't move after these statements.....
        What happens before those statements then and where is the code for that?

        Comment

        • Navdip
          New Member
          • Mar 2008
          • 22

          #5
          Originally posted by r035198x
          What happens before those statements then and where is the code for that?
          Code:
           else if (e.getSource() == liveButton)
                {
          		  JOptionPane.showMessageDialog(null,"Clicked on live-Button","Honey well",1);//Debug
                  liveData = true;
                }
              }
          
              private void browseFile()
              {
          		JOptionPane.showMessageDialog(null,"INSIDE Browse fxn 01","Honey well",1);//debug
          		events.append("\tinside Browse function");//debug1
                JFileChooser filechooser=null;
          
                filechooser = new JFileChooser();
                      events.append("file chooser  "+filechooser);
                events.append("Creation of file chooser");//debug2
                JOptionPane.showMessageDialog(null,"INSIDE Browse fxn after creating filechooser object 02","Honey well",1);//debug3
                //filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
          
                filechooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);//Debug (nav)
                JOptionPane.showMessageDialog(null,"INSIDE Browse fxn after choosing file type 03","Honey well",1);//debug4
          
                filechooser.showOpenDialog(this);//debug (nav)
                //if(filechooser.showOpenDialog(this) == JFileChooser.CANCEL_OPTION)
                //  return;
          
                evtFile = filechooser.getSelectedFile();
          
                if(evtFile == null || evtFile.getName().equals(""))
                {
                  JOptionPane.showMessageDialog(this, "Invalid Event Log Filename", "Invalid Filename", JOptionPane.ERROR_MESSAGE);
                }
                else
                {
                  parseFile(evtFile);
                }
              }
          this code is working when i run it as individually but in main project in create problem in "debug 2" may it possible it is unable to create File chooser' object..i am sending u just a part of module, the whole module is impossible to send..

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            What does your stack trace say then?

            Comment

            • Navdip
              New Member
              • Mar 2008
              • 22

              #7
              Originally posted by r035198x
              What does your statck trace say then?
              What do u want to ask..???

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by Navdip
                What do u want to ask..???
                Looks like I edited that mispel too late.
                I meant what does the logging output show?

                Comment

                • Navdip
                  New Member
                  • Mar 2008
                  • 22

                  #9
                  Originally posted by r035198x
                  Looks like I edited that mispel too late.
                  I meant what does the logging output show?
                  it will call the parse function atlast in which we have passed the Binary file that would be choosed from some location..and the parse function parse it according structure and display some data in JTextArea...pro blem is arising when we create object of JFileChooser class...

                  Comment

                  Working...