473,473 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

The Confirm Dialog Box is not coming properly.

dmjpro
2,476 Top Contributor
Actually I am trying to POP-UP a confirmation dialog box.
Here is my code ...
Expand|Select|Wrap|Line Numbers
  1. class myFrame{
  2. .
  3. .
  4. .
  5. void actionPerformed(ActionEvent evt){
  6.  new StartProcess(this).start();
  7. }
  8. .
  9. .
  10. .
  11. }
  12.  
  13. class StartProcess extebds Thread
  14. {
  15.  JFrame frame;
  16.  StartProcess(JFrame frame){
  17.    this.frame = frame;
  18.  }
  19.  public void run(){
  20.   do();
  21.  }
  22.  
  23.  private do(){
  24.    JOptionPane.showConfirmDialog(frame ...............); //it's coming but not properly
  25.  }
  26. }
  27.  
Debasis Jana
Mar 31 '08 #1
8 2006
r035198x
13,262 MVP
Actually I am trying to POP-UP a confirmation dialog box.
Here is my code ...
Expand|Select|Wrap|Line Numbers
  1. class myFrame{
  2. .
  3. .
  4. .
  5. void actionPerformed(ActionEvent evt){
  6.  new StartProcess(this).start();
  7. }
  8. .
  9. .
  10. .
  11. }
  12.  
  13. class StartProcess extebds Thread
  14. {
  15.  JFrame frame;
  16.  StartProcess(JFrame frame){
  17.    this.frame = frame;
  18.  }
  19.  public void run(){
  20.   do();
  21.  }
  22.  
  23.  private do(){
  24.    JOptionPane.showConfirmDialog(frame ...............); //it's coming but not properly
  25.  }
  26. }
  27.  
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".
Mar 31 '08 #2
ajos
283 Contributor
Expand|Select|Wrap|Line Numbers
  1. class StartProcess extebds Thread
  2.  
Debasis Jana
I think there is a typo in extends. I hope its a mistake
Mar 31 '08 #3
JosAH
11,448 Recognized Expert MVP
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
Mar 31 '08 #4
dmjpro
2,476 Top Contributor
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....
Expand|Select|Wrap|Line Numbers
  1. public class TableListFinal extends javax.swing.JFrame {
  2. .
  3. .
  4. .
  5. .
  6. .
  7.  
  8.     private void startCopy(java.awt.event.ActionEvent evt) {                           
  9.             PerformTransform pt = new PerformTransform(GeneralUtility.target_connection,GeneralUtility.source_connection
  10.                     ,table_lists,GeneralUtility.source_index_info,logDetailsTextArea,this,source_list_table,target_list_table,noSelectedRows);
  11.             pt.start();
  12.             }
  13. .
  14. .
  15. .
  16. .
  17. }
  18.  
  19.  
  20. public class PerformTransform extends Thread{
  21. .
  22. .
  23. .
  24. .
  25. .
  26. .
  27. public PerformTransform(Connection p,Connection s,String[] TableNames,String source_index_info,JTextArea logarea,JFrame mainFrame
  28.             ,DefaultTableModel srcTabModel,DefaultTableModel tgtTabModel,int[] selectedIndices) throws Exception{
  29. .
  30. .
  31. this.mainFrame = mainFrame;
  32. .
  33. .
  34. }
  35.  
  36. public void run(){
  37.         try{
  38.             StartProcess();
  39.         }catch(Exception e){
  40.             logarea.setText(logarea.getText()+e.getMessage());
  41.         }
  42.     }
  43.  
  44.  public void StartProcess() throws Exception{
  45. .
  46. .
  47. if(JOptionPane.showConfirmDialog(mainFrame,"The Object: "+TableNames[i]+"("+tab_rows[i]+") already existed!! Want to overwrite?","Warning!!",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
  48.                     GeneralUtility.overWritten = true;
  49.                     Statement tab_drop_stmt = p.createStatement();
  50.                     tab_drop_stmt.execute("drop table "
  51.                             +(GeneralUtility.tgt_tablewrappedwithsemicolon.equals("YES")?"\"":"")
  52.                             +TableNames[i]
  53.                             +(GeneralUtility.tgt_tablewrappedwithsemicolon.equals("YES")?"\"":""));
  54.                     tab_drop_stmt.close();
  55.                 }
  56. .
  57. .
  58. .
  59. }
  60. .
  61. .
  62. .}
  63.  
Debasis Jana.
Mar 31 '08 #5
ajos
283 Contributor
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
Mar 31 '08 #6
dmjpro
2,476 Top Contributor
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.
Apr 3 '08 #7
JosAH
11,448 Recognized Expert MVP
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
Apr 3 '08 #8
dmjpro
2,476 Top Contributor
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
Apr 4 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Billy | last post by:
Hi... I have a problem with a confirm dialog box. I want to execute some code and then prompt the user with a confirm dialog box who's message will depend on the result of the execution from...
3
by: ad | last post by:
I want user can confirm before delete records ? How can I show a confirm dialog when users press a button?
3
by: ad | last post by:
I can only use the OnClientClick event of a button to show a confirm dialog like: OnClientClick="return confirm('Are you sure?');" Can we show the confirm dialog by progrm, net triggered by a...
1
by: James | last post by:
CWinFormsDialog in .net 2.0 lets you host a .Net UserControl as a dialog in a managed C++ MDI application. I.e. in the sample: ----------------------------------------------- #include...
8
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form...
4
by: mamun | last post by:
Hi All, I have the following situation and am looking for answer in C#. I have a datagrid and putting checkbox next to each record. In the header I have a Delete button. I want users to...
0
by: aarthiraaj | last post by:
In my user screen I have view link, if I click this link it will go to servlet and open one word document. It is opening properly, but while opening the attachment it generate one dialog box like...
13
by: MikeC | last post by:
I read in the book Javascript The Definitive Guide by David Flanagan the following in reference to the use of alert, confirm, and prompt. "Although these dialog methods are extremely simple and...
1
by: =?Utf-8?B?UmFq?= | last post by:
In my user control, I have included javascript code using ScriptManager.RegisterClientScriptBlock(). JavaScript code has a confirm message dialog box and we store the message value in a hidden...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.