The Confirm Dialog Box is not coming properly.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    The Confirm Dialog Box is not coming properly.

    Actually I am trying to POP-UP a confirmation dialog box.
    Here is my code ...
    [code=java]
    class myFrame{
    .
    .
    .
    void actionPerformed (ActionEvent evt){
    new StartProcess(th is).start();
    }
    .
    .
    .
    }

    class StartProcess extebds Thread
    {
    JFrame frame;
    StartProcess(JF rame frame){
    this.frame = frame;
    }
    public void run(){
    do();
    }

    private do(){
    JOptionPane.sho wConfirmDialog( frame ............... ); //it's coming but not properly
    }
    }
    [/code]

    Debasis Jana
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by dmjpro
    Actually I am trying to POP-UP a confirmation dialog box.
    Here is my code ...
    [code=java]
    class myFrame{
    .
    .
    .
    void actionPerformed (ActionEvent evt){
    new StartProcess(th is).start();
    }
    .
    .
    .
    }

    class StartProcess extebds Thread
    {
    JFrame frame;
    StartProcess(JF rame frame){
    this.frame = frame;
    }
    public void run(){
    do();
    }

    private do(){
    JOptionPane.sho wConfirmDialog( frame ............... ); //it's coming but not properly
    }
    }
    [/code]

    Debasis Jana
    The code you posted is not valid Java code. How can we tell what is wrong with your code when you haven't posted it properly.
    Also explain what you mean by "not coming up properly".

    Comment

    • ajos
      Contributor
      • Aug 2007
      • 283

      #3
      Originally posted by dmjpro
      [code=java]
      class StartProcess extebds Thread
      [/code]

      Debasis Jana
      I think there is a typo in extends. I hope its a mistake

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by ajos
        I think there is a typo in extends. I hope its a mistake
        There's also a keyword 'do' used as a method (without a return type) name.
        That what was shown is a mess and has never even compiled properly. IMHO
        a poster should do his/her best to show us the real code that is giving problems,
        not something that came up the poster's head as a vague idea. On top of that,
        this particular poster should read the API documentation before dumping his
        vague problems in this forum.

        kind regards,

        Jos

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          Originally posted by r035198x
          The code you posted is not valid Java code. How can we tell what is wrong with your code when you haven't posted it properly.
          Also explain what you mean by "not coming up properly".
          Actually JOS a i have a large code that's y i didn't post it ....
          Just simply written a code ......
          Actually what happens with my Confirmation Dialog Box .. it's coming with a empty BOX ..no text is there and it can't b closed .....
          This is what happening.
          Could you figure out dat?

          Here is my code....
          [code=java]
          public class TableListFinal extends javax.swing.JFr ame {
          .
          .
          .
          .
          .

          private void startCopy(java. awt.event.Actio nEvent evt) {
          PerformTransfor m pt = new PerformTransfor m(GeneralUtilit y.target_connec tion,GeneralUti lity.source_con nection
          ,table_lists,Ge neralUtility.so urce_index_info ,logDetailsText Area,this,sourc e_list_table,ta rget_list_table ,noSelectedRows );
          pt.start();
          }
          .
          .
          .
          .
          }


          public class PerformTransfor m extends Thread{
          .
          .
          .
          .
          .
          .
          public PerformTransfor m(Connection p,Connection s,String[] TableNames,Stri ng source_index_in fo,JTextArea logarea,JFrame mainFrame
          ,DefaultTableMo del srcTabModel,Def aultTableModel tgtTabModel,int[] selectedIndices ) throws Exception{
          .
          .
          this.mainFrame = mainFrame;
          .
          .
          }

          public void run(){
          try{
          StartProcess();
          }catch(Exceptio n e){
          logarea.setText (logarea.getTex t()+e.getMessag e());
          }
          }

          public void StartProcess() throws Exception{
          .
          .
          if(JOptionPane. showConfirmDial og(mainFrame,"T he Object: "+TableName s[i]+"("+tab_row s[i]+") already existed!! Want to overwrite?","Wa rning!!",JOptio nPane.YES_NO_OP TION)==JOptionP ane.YES_OPTION) {
          GeneralUtility. overWritten = true;
          Statement tab_drop_stmt = p.createStateme nt();
          tab_drop_stmt.e xecute("drop table "
          +(GeneralUtilit y.tgt_tablewrap pedwithsemicolo n.equals("YES") ?"\"":"")
          +TableNames[i]
          +(GeneralUtilit y.tgt_tablewrap pedwithsemicolo n.equals("YES") ?"\"":""));
          tab_drop_stmt.c lose();
          }
          .
          .
          .
          }
          .
          .
          .}
          [/code]

          Debasis Jana.

          Comment

          • ajos
            Contributor
            • Aug 2007
            • 283

            #6
            Originally posted by dmjpro
            Actually JOS a i have a large code that's y i didn't post it ....
            Just simply written a code ......
            Actually what happens with my Confirmation Dialog Box .. it's coming with a empty BOX ..no text is there and it can't b closed .....
            This is what happening.
            Could you figure out dat?

            Debasis Jana.
            I think jos said it right
            There's also a keyword 'do' used as a method (without a return type) name. That what was shown is a mess and has never even compiled properly
            You cant use a method called do(), its a keyword as jos mentioned

            Comment

            • dmjpro
              Top Contributor
              • Jan 2007
              • 2476

              #7
              Originally posted by ajos
              I think jos said it right

              You cant use a method called do(), its a keyword as jos mentioned

              Sorry Guys.
              But I don't Understand still why it was not coming then.
              Same code I run today ..it's coming properly.
              Strange!!!!
              Anyway Thanks for your helps.

              Debasis Jana.

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                You always encounter those sort of problems: something doesn't work and after
                one of your threads has received tips, hints, etc. all of a sudden automagically
                your problem seems to be solved. Are you going to figure out what caused the
                problems initially or are you going to leave all that voodoo in. I don't believe in
                voodoo and I trust that sort of code as far as I can throw a rock at it.

                kind regards,

                Jos

                Comment

                • dmjpro
                  Top Contributor
                  • Jan 2007
                  • 2476

                  #9
                  Originally posted by JosAH
                  You always encounter those sort of problems: something doesn't work and after
                  one of your threads has received tips, hints, etc. all of a sudden automagically
                  your problem seems to be solved. Are you going to figure out what caused the
                  problems initially or are you going to leave all that voodoo in. I don't believe in
                  voodoo and I trust that sort of code as far as I can throw a rock at it.

                  kind regards,

                  Jos
                  Thanks ... :-)

                  Debasis Jana

                  Comment

                  Working...