• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing - Bring Frame to top  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an Internal Frame and a button in the Internal Frame that opens another Internal frame to the desktop. Problem is, it opens behind the first frame. Can someone tell me how to make it appear on top?
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JInternalFrame has a toFront() method. Have you tried that? If you are using a JDesktopPane for a container, there is also a setSelected(JInternalFrame) method that may work.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neither seems to work. I tried myJInternalFrame.toFront();
compiles, but does nothing.
then I tried myDesktopPane.setSelectedFrame(myJInternalFrame);
again, compiles, but does nothing.
Thanks for your help though.
 
syed fazal faheem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
call parentFrame.show() after bringing the internalframe to front.

[This message has been edited by syed fazal faheem (edited July 13, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!