开发者

JDialog goes behind after progressbar finishes

开发者 https://www.devze.com 2023-04-06 07:17 出处:网络
I have JPanel, from which I am opening a search criteria Dialog that extends AbstractAIFDialog. It consists of search criteria text field, result table view and search button. After clicking Search, i

I have JPanel, from which I am opening a search criteria Dialog that extends AbstractAIFDialog. It consists of search criteria text field, result table view and search button. After clicking Search, in this dialog, I need to show progress bar till I get the result from database.

I am calling the below function when Search button is clicked:

SearchResult res = SearchExecuteHelperUtils.execute(searchService, 0);

The above execute function definition is as below:

public static SearchResult execute(SearchProvider searchService, int nLoadAll)
        throws Exception

{    
    final Display display = PlatformUI.getWorkbench().getDisplay();
    if(display != null)
        display.syncExec(new Runnable() {

            public void run()
            {
                try
                {
                    (new ProgressMonitorDialog(display.getActiveShell())).run(true, true, executeSearch);
                }
                catch(InvocationTargetException e)
                {
                    e.printStackTrace();
                }
                catch(InterruptedException e)
                {
                    e.printStackTrace();
                }
            }

The problem is that I have the JPanel open. On top of it I have the Search criteria dialog. On click of Search button, progress bar appears, but after progress bar closes, results are populated in the Searc开发者_开发知识库h dialog but the dialog goes behind the JPanel.

What should I do?


..I have the JPanel open. On top of it I have the Search criteria dialog. On click of Search button, progress bar appears, but after progress bar closes, results are populated in the Search dialog but the dialog goes behind the JPanel.

It seems as though the JPanel should be the component passed to a JOptionPane that shows the progress bar/search results.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号