开发者

Java Panel not updating completely occasionally

UPDATE - 21/09/2011

I have done an initial cursory review of the code and anywhere it looks like it's updating the user interface it's doing it via:

SwingUtilities.invokeLater(new Runnable() {
    public void run() {
        // code goes here
    }
});

The main updates to the UI happen in a single place which first does the above wrapper and then asks the current visible panel to update itself within that thread, so it should be within the EDT, if I understand it correctly?

That said, there could be odd places i've missed. Currently i'm working with some AspectJ code i've found here:

http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html

to see whether this will highlight any odd places where it's not doing the right thing.

Other than that though, any other thoughts?

Re: transparency assumptions - how would this be manifested? What am I looking for? While i've done a fair bit of work improving the code, it's largely inherited from previous people so I'm not as intimately familiar with it as might be helpful :)

Re: pasting code fragments - I'd love to, but without narrowing the problem down I can't think of a sensible constrained fragment to post, I literally have no idea where the problem might lie in the code unfortunately.

Thanks for all the responses thus far.

ORIGINAL QUESTION

We have an application that is hosted inside a third party system. Our part is a JPanel that is returned, the host application (Lagan CRM) then embeds that Panel in to their application.

In most cases this is working very well, however occasionally, and in only one implementation that we know of, the panel does not update correctly - it's like something has stopped a part of the panel from being updated.

In the screenshots below, our JPanel is right at the bottom, the top left of it is essentially the "INFO" button.

Here are a few screenshots demonstrating the issue:

In this example, the issue is visible around the "Go unavai开发者_运维问答lable" and "Dial" button area.

Java Panel not updating completely occasionally

In this example, the issue is in the same general area but it is not the same dimensions, indeed we've not found any commonality in respect of the area / size of the anomoly.

Java Panel not updating completely occasionally

In this example i've done a bit more communication with the user and it seems like what happened was the user prior to the current call the user had the "GO UNAVAILABLE" button shown. They then started a conversation with a caller, which means that the system should then start showing "CONNECT" on the top left, the phone number below and it has the HANGUP button on the right. As you can see, it's updated only around the outside of it, there's a large block in the middle area that has not been updated at all and is still acting as though they're not on a call. Besides looking ugly, it causes problems because there are two or three buttons that should replace the "GO UNAVAILABLE" one and this means that functionality is not accessible.

Java Panel not updating completely occasionally

I just wanted to show a few examples so that you can see they are different blocks each time, but the basic issue is always the same.

Some basic stats:

  1. Only happens on XP machines.

  2. Only happens at one customer site out of about 10-15 sites that use it, but happens on all the machines at that site.

  3. I've asked about windows popping up over the top but the only one they are aware of they have sent me a screenshot for and it doesn't overlap much, certainly nothing remotely similar to these patterns.

  4. Java 1.5 is being used on this site, getting 100+ workstations updated to 1.6 is not impossible but I would need to have some reasonable indication it's going to help.

  5. We have many other sites on 1.5 without this issue.

  6. We've asked about what other software might be running on the machines and to be honest there's very little as they are contact centre agent workstations and tightly bolted down.

  7. The panel will right itself once the caller hangs up, but it means the agent effectively loses that call as they can't do anything with it. This implies to me it's essentially being blocked from an update rather than being persistently blocked.

  8. Panel is implemented in SWING, nothing particularly fancy in there.

Any hints, tips, guidance, suggestions for other questions I can get answers to - or even better, solutions :) would be very gratefully received.


Since I am not able to see the code this answer is more from what you could try to do with the information I have :)

  1. Updating a JPanel is tricky if not done from the EDT. Even when done from the EDT I have had issue when trying to change the entire structure of the JPanel and repainting it. Instead in these places I have changed to using a JTabbedpane. Drop a tab and recreate it. Much more easier to do. I am not sure if that will help in this case.
  2. Next the layout. Are you using any Layout manager? If you have absolutely positioned stuff, then depending on the monitors size and resolution all things will go haywire. I would recommend using the JGoodies - Forms layout. Link here - http://www.jgoodies.com/freeware/forms/

Sorry couldnt be more of help.. :(

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜