 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
anders Guest
|
Posted: Sat Jun 19, 2004 10:29 am Post subject: jdesktop, jinternalframe update/repaint problem after jdialo |
|
|
Hello,
I have an application that uses a JDesktopPane, with a menubar
and several opened JInternalFrames, some of them partly covering
the visible surface of another.
I can bring to front each of them and the JDesktopPane and
all frames will be repainted correctly.
But if I open a JDialog, to get some user input, the JDesktopPane and
all frames will NOT be repainted once I close the JDialog, i.e. a big
grey surface remains on the screen where the JDialog was.
First I tried to add
System.out.println("a");
desktopPane.revalidate();
desktopPane.repaint();
System.out.println("b");
after the JDialog is closed but this doesn't seem to have an impact.
I can see the "a" and the "b" in the output, hence the revalidate and
paint should have been issued.
Next I tried to revalidate and repaint all the open frames with:
JInternalFrame[] frames = desktopPane.getAllFrames();
for(int i=0; i < frames.length; ++i)
{
frames[i].revalidate();
frames[i].repaint();
};
but this does not update the screen either.
The only thing that works is
JInternalFrame[] frames = desktopPane.getAllFrames();
for(int i=0; i < frames.length; ++i)
{
frames[i].toFront();
};
But this is not very "nice" as it brings to front unecessary windows.
I can of course program it bit smarter so that only internalframes
with visible parts are put to front, but I guess there must be a simpler
way?
any ideas?
thanks in advance!
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|