Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8147171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:15:41+00:00 2026-06-06T14:15:41+00:00

I am checking the below condion and displaying dialog box if(query.contains(tab)) { JOptionPane.showMessageDialog(null,Owner does

  • 0

I am checking the below condion and displaying dialog box

if(query.contains(tab))
        {
        JOptionPane.showMessageDialog(null,"Owner does not have privileges to access given table");
        }

I want when the dialog box is displayed and condition is true .further execution should stop there itself.How to do this?

and Does JOptionPane degrades application performance? because my application takes lot of time to display dialog box.

Edit:

  for(int i=0; i<ia.length; i++) 
      {

                tab=  ia[i].toString(); 
                    if(query.contains(tab))
                {
                    JOptionPane.showMessageDialog(null,"Owner does not have privileges to access given table");
                    break;
                }
        }
//rest code
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:15:42+00:00Added an answer on June 6, 2026 at 2:15 pm

    Based on you comments on @Robin’s answer:

    It stops untill the user disposes dialog but I want to stop the
    further execution even after the dialog box is closed i.e I want to
    stop execution of task which are there after above if block.


    Please see edited post.I want to block rest code part,how can I add
    it in else?

    What you can do in your case is: take a flag to decide whether to execute rest of code or not. Some thing like:

    boolean executeCode = true; // boolean flag to decide
    for(int i=0; i<ia.length; i++)  {
       tab=  ia[i].toString(); 
       if(query.contains(tab)) {
          JOptionPane.showMessageDialog(null,
                       "Owner does not have privileges to access given table");
          executeCode= false; // do not want to execute the rest of code
          break;
       }
    }
    if (executeCode) {
       //rest code
    }
    

    I’m not completely sure that I have understood your problem well, but I posted this answer based on what I understood from your above comments and it might also become hard to explain this in comments. Notify me if I’m wrong or have not understood it properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the below I am checking every input field is not empty if (
The code below does not return any errors and I can make it return
The below query works great when it comes to checking radio buttons and having
When checking for nulls I use this: String str; if(str == null){ //... }
I want to compile a time error checking as mentioned below . But I
As you can see below, I am checking to see if the current user
The below check is not working: if [ $LEN = `expr $CNPROC + $CTotal`
In Program.cs I have the below method that is checking and the Syncing 5
As in the simplified code below, is checking that SendAsync() has finished transmitting all
I would like to group the table below and return parts_number while checking the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.