ContentPane not rendering in threaded JDialog

I want to popup a small dialog whilst my main thread is executing telling the user to be patient.
So, I create JDialog that implements Runnable.
public class TheSplash extends JDialog implements Runnable
public TheSplash(Frame f) {
    super(f, true);
    setTitle("blabla");
    JPanel p = new JPanel();
    JLabel l = new JLabel("text");
    p.add(l);
    getContentPane().add(p, BorderLayout.CENTER);
    setSize(150, 100);
    setLocationRelativeTo(f);
public void run() {
    setVisible(true);
}Now, in my main thread (Event Despatch Thread) I do
final TheSplash splash = new TheSplash(someFrameInstance);
Thread t = new Thread(splash);
t.start();
// lengthy processes happen here
splash.setVisible(false);
splash.dispose();
// more stuffNow, the dialog displays and disappears at the required times, but the only things rendered on screen are the actual dialog and title, but not the contentPane of the TheSplash instance.
What gives? I tried forcing it to repaint right after completion, doing a step-by-step debug through the code, the code runs through the entire TheSplash constructor as expected, without errors...
Any help appreciated....

Hi,
you have to put the setVisible(true) method in the EventDispatchingThread. At the moment it is not in the E-Thread because you explicitly start a new Thread Thread t = new Thread(splash);Change this to
SwingUtilities.invokeLater(splash);and run the lengthy process in a separate Thread (not the E-Thread) and join() this thread to get informed of the end.
Thread t = new Thread(new Runnable() {
  public void run() {
     // lengthy process
t.start();
t.join();All GUI-things in the lengthy process must be dispatched to the E-Thread.
Ulrich

Similar Messages

  • JSF Pages are not rendering correctly when  loaded using Non JSF actions

    Hi All,
    This problem is irritating me and I am posting the same query for the third time here.
    When I come from non jsf actions such as page submitting using Javascript, clicking anchor link, clicking normal Html submit button and so on my page is not rendering correctlly .
    In other words, My first GET method/Post method works perfectly for the first time when the page is loaded.
    But when we try to access the page for the second time, although logical work is perfect in bean, I am getting same old page.
    How to resolve this issue?
    or
    Is this Bug of Sun's Implementation of JSF Framework.
    Thanks,
    Sudhakar

    Hi Sudhakar,
    There is a discussion about refreshing a page, Take a look at the below thread
    http://swforum.sun.com/jive/thread.jspa?threadID=55660
    Hope this what you are looking for
    MJ

  • LIbrary thumbnails not rendering

    I have dozens and dozens of thumbnails in library grid that do not render.  The boxes show up as empty grey squares with keyword icons among others.  There does not seem to be any pattern or reason that some photos render fine and others do not.  If a photo is taken to develop mode then the thumbnail renders as the photo loads in the main window, otherwise the same photos that are all grey in library view are grey in develop view until the individual photo is loaded.  Closing LR and reopening it seems to cause any photo which was originally not rendered but then forced to render in develop to go back to the unrendered state.
    This is driving me crazy as I cannot count on LR to display the images I have in the catalog.  Syncing a folder which has many of these unrendered previews does not indicate any missing files.
    Help.
    Lightroom 3.2 64 bit
    Windows 7
    Catalog w/ about 18000 images upgraded from LR 2.7

    Check other threads in this forum.  I recall this is usually caused by a bad display colour profile. This is apparently more common with some Windows systems.

  • PanelGrid with binding attribute not rendering when event on page fires

    I am having a similar issue with my components not being rendered from a dynamic binding attribute as described by this post:http://forum.java.sun.com/thread.jspa?threadID=671672 but for different reason. I have combed the forum and other sources for a week now, tried numerous variations of this based on suggestions I've read for rendering dynamic components and am unable to find the problem. I would appreciate guidance as I don't know what else to do and I imagine there is something basic about the JSF flow layout or component classes I am not doing correctly.
    From a high level, I have a page with two panel groups. The first contains a list of command links (like a menu) that have an actionlistener that populates a list of QueryVariable objects called filterCriteria in the backing bean based on the selection made and then calls a function to update components in the second panel. The second panelGroup contains a panelGrid with a binding attribute that constructs a dynamic set of input fields based on the content of the filterCriteria list. When I first naviagate to this page from another page, the fields are rendered properly. However, if I then select a commandLink from the menu, the panelGrid disappears and is not rendered.
    I've stepped through the code in a debugger and my actionlistener is called when I select a command link. However, the binding attribute method is not called at this time, so I added a direct call to it from the action listener. I know the actionlistener is working because I've verified it in the debugger and if I navigate away and come back to the page, then the binding method is called and the new selection is reflected in a rendered panelGrid. Why is it not rendering though when I first select the commandLink and the page is updated. Also, fyi, there is an action method for the commandlinks but it returns null;
    FWIW, I'm using MyFaces and Facelets in my application.
    Below is my code. This is inside a managed session bean:
    JSF Snippet:
    <h:panelGrid id="inputVarsTable" columns="3" binding="#{query.table}"/>
         public HtmlPanelGrid getTable() {
              if(table == null)
                   table = new HtmlPanelGrid();
              return constructSearchInputTable();               
         public void setTable(HtmlPanelGrid table) {
              this.table = table;
      // Updates table component to reflect filterCriteria
         public HtmlPanelGrid constructSearchInputTable()
              HtmlOutputLabel outLabel;
              HtmlOutputText outText;
              HtmlInputText  inText;
              HtmlMessage message;
              List<UIComponent> children;
              ValueBinding vb;
              FacesContext facesContext = FacesContext.getCurrentInstance();
              UIViewRoot uIViewRoot = facesContext.getViewRoot();
            Application application = facesContext.getApplication();
              children = table.getChildren();
        children.clear();
              try {
                   for (int i = 0; i < getFilterCriteria().size(); i++) {
                        QueryVariable var = getFilterCriteria().get(i);
                        String id = "var" + i;
                        //<h:outputLabel for="#{var.name}" styleClass="label">
                        outLabel = new HtmlOutputLabel();               
                        outLabel.setFor(id);
                        outLabel.setStyleClass("label");
                        //  <h:outputText value="#{var.name}" />
                        outText = new HtmlOutputText();
                        outText.setValue(var.getName());
                        outText.setParent(outLabel);
                        outLabel.getChildren().add(outText);
                        outLabel.setParent(table);
                        children.add(outLabel);
                        //<h:inputText id="#{var.name}" value="#{var.value}" required="true" />
                        inText = new HtmlInputText();
                        inText.setId(id);
                        String bind = "#{query.filterValues['" + var.getName() + "']}";
                        inText.setValueBinding("value", application.createValueBinding(bind));
                        if(var.getDefaultValue() == null)
                             inText.setRequired(true);
                        inText.setParent(table);
                        children.add(inText);
                        //<h:message for="#{var.name}" styleClass="errorText"/>
                        message = new HtmlMessage();
                        message.setFor(id);
                        message.setStyleClass("errorText");
                        message.setParent(table);
                        children.add(message);     
              } catch (Exception e) {
                   log.error(e);
              return table;
      // Command Link Menu ActionListener
         public void structuredQuerySelection(ActionEvent e) {
              queryType = QueryType.StructuredQuery;
              UICommand cmd = (UICommand) e.getSource();
              filterSelection = (String) cmd.getValue();
              Map<String, SearchRequestCtx> queries = pdp.getGenericMetadata().savedQueries;
              SearchRequestCtx ctx = queries.get(filterSelection);
              filterCriteria = new ArrayList<QueryVariable>();
              filterCriteria.addAll(ctx.getVariables());
              constructSearchInputTable();
         // Command Link Menu Action
         public String selectStructuredQuery()
              return null;
         }BTW, this is my first post and I don't really know how that Duke Dollar thing works but I'm happy to offer some to anyone that can solve this issue for me.
    Thanks,
    Ken

    Glad to hear I am not the only one struggling with this type of issue.
    I tried your suggestion but it caused a NoSuchElementException when the page tried to render. Stepping through the code, the init function is always called after my panelGrid is constructed. I even commented out the logic to clear the children and confirmed that in the constructed page, the outputText component that binds to init is the first element on the page - right after the opening body tag. Maybe, JSF doesn't necessarily construct the page in top to bottom order? Also, the exception makes me think that this gets called too late in the lifecycle to work. Were you able to get this to work?
    java.util.NoSuchElementException
         at java.util.AbstractList$Itr.next(AbstractList.java:427)
         at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:515)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:445)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)Ken

  • ADF FACES: af:table not rendering all columns

    I'm using ADF EA 17 with myFaces 1.0.9 on JBoss 4.0.1/JVM 1.4.2_07-b05. The af:table is embedded within an af:panelgroup (being body of af:panelbox).
    The af:table is not rendering all columns (only last 2 out of 8 cols total). The model behind the af:table is a java.util.List. Debugging shows that the list is filled up with beans correctly and that each of the properties of such a bean corresponding to a table column are also set correctly.
    Strange thing is that sometimes all columns are rendered ok. Especially if i make heavy changes on the jsp (e.g. removing all but 2 cols from the af:table) and dropping it into the .../jboss/server/../tmp/deploy/tmpXYZ-exp.war directory. Restarting JBoss results in the old behaviour. Also closing browser and re-opening it yields to the missing columns again.
    I've set breakpoints on the bean properties representing on table column and i can see, that the getter methods aren't called (all but those 2 that get rendered finally)
    Table has multiselection enabled with 1 command button.
    This happens with both IE 6 and Firefox 1.0.4; no oracle, myFaces exceptions visible on console or any log file.
    Has anybody made same experiences so far or an idea what the problem really is ?
    best regards,
    Christoph.

    I've tried it also with a plain af:table without any surrounding af:panelgroup or/and af:panelbox. Same result.
    The bean holding the table-model (the java.util.List) is in session-scope. the table-model is update by an actionListener fetching values from an EJB. Could the session-scope be a problem ?
    Potential candidates from my point of view, that might cause trouble here:
    --) Caching (i've seen that sort of "CachedRenderers" are used
    --) partial page rendering
    --) multi-threading issue.
    --) or any silly mistake of mine :-)
    best regards,
    Christoph

  • Page is not rendered after first request

    Hi all,
    i have two page with names page1.jsp and page2.jsp. i open page2.jsp as pop up window by clicking a link on page1.jsp
    in _init() of page2.jsp,  i am getting some information from database and then i am able to create dynamic components according to information provided by database.
    for example, i create 3 textFields (their Id's are myTextField1, myTextField2, myTextField3) as result of execution of sql querry.
    Until here everything is ok for me, components looks rendered.
    i closed the page2 and then reopen it as pop up window again. i tryint to create another three textFields (their Id's are myTextField4, myTextField5, myTextField6). it looks like created at runtime, however i am getting the same old page.
    Please help me why my page is not rendering after reopening.
    Regards,

    any idea?
    it's similar problem without solution at following link
    http://swforum.sun.com/jive/thread.jspa?threadID=54347&messageID=208120#208120
    Any help apprechiated

  • Firefox OS is not displaying correctly. it appears that the CSS and JS are not rendering! Any help would be most appreciated!

    I would have preferred to show anyone a screenshot of the web pages, but there is not an attach file on this forum. Anyway, with only Firefox OS , not my other browsers, the web pages are not rendering correctly. For example on Facebook there is no header or footer. JS is active in the browser and as I said Chrome and Safari are NOT having any problems. I am surmising that the CSS and JS files are somehow not being displayed. I may be very wrong, but I would gratefully accept any help someone has to offer. Thank you and have a great day!
    Theresa

    Hi Lufte,
    I'm sorry to hear you are having issues with the rendering of some pages on your Firefox OS device.
    Please create a new question in the thread so that we can track your issue separately:
    * [https://support.mozilla.org/en-US/questions/new Ask a new question]
    Please also provide the device model and version that you're currently using, and whether this issue started recently. Please let us know if you also notice any issue with the time and date displayed in your device.
    Thanks,
    - Ralph

  • Graphics plain 2D objects are not rendered while an action occurred!!!

    Hi, I am designing a game in Swing. Currently I am designing the maze for this game. The maze is generated by using Depth First Search algorithm. In my main JFrame, I have some JPanel. One JPanel, named mazePanel contains the maze. There are some other JPanel also, which contains the JButton for controlling. Following is the mazePanel code.
    import java.awt.Graphics;
    import javax.swing.BorderFactory;
    import javax.swing.JPanel;
    public class MazePanel extends JPanel {
        private MazeGenerator mazeGenerator;
        private boolean startNewMaze = false;
        public MazePanel() {
            setBorder(BorderFactory.createTitledBorder("Maze"));
            setToolTipText("This is the maze");
        public void addNewMaze() {
            startNewMaze = true;
            mazeGenerator = new MazeGenerator();
        @Override
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            if (startNewMaze) {
                mazeGenerator.generate(g);
                startNewMaze = false;
    } There is one JButton, which calls the method mazePanel.addNewMaze() and set the Boolean startNewMaze to true. After setting the startNewMaze, maze should be generated. i.e. mazeGenerator.generate(g) is inside if() condition. Method mazeGenerator.generate(g) recursively draw the random maze. That is why I don’t want to run this method not more than once.
    Up to this everything is looking fine. But while I am running the main JFrame and clicks on the JButton, maze is not rendered in the mazePanel. Sometimes when I minimize and maximize the JFrame, maze rendered (might be because of repaint() occur). Even if I comment mazeGenerator.generate(g) inside if() condition and put some g.drawString(). The string is not rendered while action performed (i.e.Pressing JButton).
    Where is the problem? Please help.
    Thank you.
    Edited by: 889823 on Jan 28, 2012 3:28 PM (Code was not formatted correctly. I forgot to make use of tag)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This kind of thing sounds simple but in reality is fairly tricky. I dealt with these kinds of situations for years while learning java, and still sometimes do.
    You only posted a snippet of your code, from which we can't go through and debug what your problem is, but I would just say that this is the general pattern
    1. Receive the event to create a new board. This can in reality be any event that will cause your UI to change
    2. Do whatever processing you need to do to get your Component ready to be painted again. You can do short jobs on the UI thread. For longer jobs, look at the SwingWorker class
    3. When you are done processing and ready to redisplay, call repaint() on your Component. Make sure after you call repaint() that any work being done on the UIThread finishes, so that this thread can then handle the repaint request
    Edited by: tjacobs01 on Jan 28, 2012 1:37 PM

  • Adjustment Layer not rendering...

    I have a fairly basic comp consisting of 3 or 4 3d layers spaced out along the Z axis, two precomps containing some edge lighting effects, a camera, a light, and the troublesome adjustment layer. The adjustment layer only contains some color correction and a flare. I thought perhaps a certain effect may be causing the layer not to render, but i eliminated that possibility by removing the effects i had and trying several other, the layer was still not rendering.  I think I have exhausted all of the really simple solutions, nothing is solo'd, all the layers are visible in the preview, the layers are all in the correct order etc..  I can't SS the project right now as I am not at home, but i can tell you that I am working with CS5.5, on windows 8.1, i5 cpu, 8 gigs of ram. The really frustrating part is that a slightly earlier version of the project successfully rendered the adjustment layer and I don't remember changing anything major...  Suggestions?  Shots in the dark?  Anything?  I will post a SS later in the day.  Thanks in advance to any and all who have advice.

    No problem! Glad to help.
    Don't forget to mark the solution as correct, so that future forum visitors see this thread as solved. Keep having fun with After Effects and let us help if you get stumped again.

  • Effects not rendering on output to AME

    1920x1080 BMD sequence. 1080i-60i
    Mac 10.6.4
    APB CS5.5.2
    Exporting to AME queue
    Creating a Prores file, full quality.
    Effects like drop shadow not rendering out in the file.
    Clearly there in the sequence.
    Any help greatly appreciated.
    Thanks.

    Another reason for PP to add native monitoring without third-party hardware/drivers.  Please add your voice...
    http://forums.adobe.com/thread/900221?tstart=0

  • PageFlow Portlet Not Rendering

    Hello everybody,
    I'm trying to use a page flow as a source for a portlet.
    Unfortunately the portlet content is not rendered; instead, just the portlet window with the title bar is present.
    No error message is present on either the console or the server log.
    The PageFlow is a trivial one -- containing just the begin action and the index.jsp file (faces). I was able to test the pageflow directly from the IDE (choosing the `*Run on Server..*` menu action). The index.jsp content was rendered as expected. But when I tried the URLs for the portal or the portlet, no content was rendered!
    I tried the combinations: WebLogic Portal 10.2 + Workspace Studio 1.1 and WebLogicPortal 10.0 + Workshop for Weblogic Platform with the same result.
    What is the problem?! Has anyone ever experienced something similar?
    (According to the [BEA Portlet Dev docs|http://edocs.bea.com/wlp/docs100/portlets/building.html#wp1062050], using a PageFlow as a source for a portlet is a perfectly good option.)

    James thank you for your answer. I did not know about the Portal forum. May I ask the forum's admin to move this thread over there? I don't like to double-post.
    Coming back to the issue, I can confirm that indeed this is the most basic example of a portal (created ``by the book`` with a Portal EAR and a Portal Web project). And indeed, I am able to run the portlet directly from within the Workshop; I am also able to run the JPF directly from within the Workshop.
    Perhaps a sketch can explain better what I'm experiencing:
    Request for `dummy JPF` URL ----------------------> content rendered (as expected)
    Request for Portlet with `dummy JPF` URL ----------------------> NO content rendered (+unexpected+)

  • Svg still not rendering

    There have been a few topics about the svg import into Muse.
    I'm still having trouble on my website design. I keep getting the error "unable to generate thumbnail" and when exported to the browser the image doesn't show up.
    Would greatly appreciate any help!
    Using:
    Mac OSX 10.10.
    Safari

    Hi
    in case you stil have this issue, please check this thread SVG files not rendering in Muse

  • .svg files not rendering in browser

    I've just uploaded my site (www.elcricdercas.com). None of the .svg files are rendering. This includes an Edge produced file in the front page animation. How come? I've checked the site on Safari and Firefox. The provider is Eclipse.net.uk

    Hi,
    Could you please check this thread, and see if get some hint
    Re: SVG files not rendering in Muse

  • Why is my .psd file not rendering correctly in ae

    Some layers of the .psd document are not rendered correctly. However they are imported.
    The strange thing is that when I first move from Photoshop to Illustrator, save it as an .ai file it is rendered properly (in Ae).
    I am kind of clueless as to what is causing this issue.
    Kind regards,
    Jelle

    Okay if more information is needed, i'll provide. However you may disregard my initial comment about illustrator. It flattens the photoshop layers so I do not have any flexibility in After Effects. In other words, my main question remains: why is my psd file not rendering correctly in ae?
    Further details:
    -photoshop cc and after effects cc.
    -macbook pro retina
    If still not clear enough, please tell me what details you are looking for furthermore

  • SSRS report does not rendering properly in sharePoint 2013

    Hi everyone,
    I'm a newbie with the MSBI development tool, I've tried to create a testing SSRS reports and its layout showed correct when preview them in Visual Studio (2010 and 2012). Then I migrated the report in SharePoint 2013, but the layout do not rendering as I
    expected, some data mix-up on the matrix table
    The Ident on detail data (drill down) does not render properly compare the layout in when preview in Chrome or Visual Studio (SSRS)
    The summation on second matrix table went wide on both browsers compare when preview thereport in Visual Studio
    The export PDF (using the "action" button on the report in the browsers) showed the second matrix table is overlaps the first matrix table.
    This report has 3 main queries (2 for the matrix tables and 1 for the chart) on a Dev environment:
    Window server 2008 R2 with service pack 2
    SQL server 2012 enteprise with service pack 2
    SharePoint 2013 (no service pack) with integrated mode on the report service 
    Visual Studio 2010 development tools
    I'm very appreciate for anyone can provide any solution to solve this issue.
    Thank you so much,
    Dac.
    P.S.: I attached the preview of the report in both browsers (IE & Chrome) and its preview in Visual Studio.
    An update: ... due to the setting space on"snap to grid" default to 20 and I've made the 2nd matrix table overlaps the 1st one, therefore the it showed overlaps when export to PDF file ... it's solved.
    But the Indent on IE and summation still persist in both browsers.

    Hi everyone,
    The PDF's export has been solved due to the 2nd matrix table overlaps on the 1st table. 
    Also, I don't know why the summation (aka Row Total) went wide when data represented on the 2nd matrix table (see previous post on the row named as "Premium over 5000$" on both browser. So I've redesigned the 2nd table as normal table instead of
    matrix table ... and the summation showed correct (it's so weird)
    For the "Indent" issue showed in IE on both drill down of the 1st table and 2nd table which cannot be fixed, and the end user used only IE.
    Could someone can enlighten me please?
    Many thanks.

Maybe you are looking for

  • Error in file to idoc scenerio

    hi in file to idoc scenario i got error in sxmb_moni in status  it is showing recording, in Q.status it is showing stop symbol. waiting for suggestions.

  • How to create a DSN-less connection to SQL Server for linked tables in Access

    hey i cant understand how i use that Function if that information what you need  stLocalTableName: dbo_user_name stRemoteTableName: user_name stServer :sedo2015.mssql.somee.com stDatabase :sedo2015 stUsername :sedo_menf_SQLLogin_1 stPassword :1234567

  • Printing Problem Solved (Temporary Work-around)

    I've posted before, and others have posted here and elsewhere, about problems printing with Aperture since upgrading to Leopard. In my case, it's been with an Epson R1800. Well, believe it or not, with the help of Epson support on the phone, I've fig

  • HT2515 audio chat with ichat -- help needed!

    I have just purchased a new macbook air and i am new to MAC. I am  unable to do audio chat through ichat (google talk) with others who are using gtalk on windows enabled PC/ laptops..can some one pleas help me through? Thanks...

  • ACR 3.6 Leica M8 camera profile

    Hi, I have CS2 premium suite on Windows XP. This included ACR3.6 that I can access either via PS or Bridge. I have installed ACR 3.7 update. Bridge recognises the new Raw plug-in when I opened it. I have imported DNG files from Leica M8. I think that