1
votes

I am developing an AWT application. It runs smoothly on single monitor. However, when used with a multiple monitor set up:

  1. Often dialog boxes open blank: complete black spot the size of a dialog, even top window system icons do not appear. Once moved or after any action performed on that blank part - resize, move etc, content appears normally.

  2. When application is "put" on secondary monitor. The dialogs open on primary monitor only with the issues described above.

Although the issue is not found to be consistent when used with Win 7, issues occur more frequently on Windows XP.

Is this a standard Java Bug like this and related ones?

Any workarounds?

1
Any work arounds for don't use prehistoric Components that died in last milenium, 2) that's talk about Mixing Swing and AWT J/Components 3) blank Container missed RootPane by using Top-level Container#removeAll()mKorbel
I really don't get why people still insist in using AWT ... good luck!Angel O'Sphere
application is originally 10 years old.. the years ago, i learnt printf !!! have to use wats given!! its my first exp with any kind of dekstop appli!!MalTec

1 Answers

1
votes

I've also encountered quite some multi-monitors issues: most notably the Robot class is badly broken on some JVMs in multi-monitors setup. For example it's darn near impossible to get consistent screenshots when there are multiple monitors hooked up to an OS X system.

Any work arounds for the same?

Well if you ask for a workaround, there's an obvious one regarding what you described: if any move/resize action force the content to appear normally then you could programmatically trigger a fake mover or resize action which may be a workaround your problem.

Been there, done that: in one app we had to use a (broken) 3rd party graphing API that had broken displaying issues. In one case a graph wouldn't show up correctly unless we resized the window: it was a known bug but not fixed yet. Our solution consisted in forcing a one-pixel resize of the window. It's a crappy workaround, but it worked. To this day we haven't had a single user complaining (it's really very hard to spot a one-pixel resize).

I'd like to re-emphasis that this is a hack but, sometimes, workarounds are needed. I'm not saying that there's not a better solution in your cases. You asked for a workaround, so here's one...