JInternalFrame precedence

hi guys, i have an application with some inernal frames in a desktop, one of

those internal has a canvas object, the problem is that when you focus a internalframe it is suppose to go to the front of the screen, but with the internal canvas all the others lays behind it, i know there must be a property but i can磘 find it, please help me

[352 byte] By [ander123a] at [2007-11-26 13:35:45]
# 1
Do I get you right -- you mix Canvas and JInternalFrame? Don't! Replace Canvas by (a subclass of) JComponent.
quittea at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 2
i had to, because im just starting in java(3 moths ago) and the internal also havea button a a JTable, but, could you help me?
ander123a at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 3
http://www.devx.com/tips/Tip/14718Use JButton instead of Button.
quittea at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 4
i mean about the image layering
ander123a at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 5
Yes, the problem with mixing AWT and Swing components is layering ...I think it's time for a more detailed description of your problem.
quittea at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 6

sorry youre right, i simply has a lot of jinternalframes with jcomponents,

just one of those jinternal has a canvas with a 2d grapher which redraws its

self dependending of the size of the jinternal , no matter how much i tried, the canvas remain in front on the screen blocking even the desktop JMenubar, its now fully functional but it looks ugly.

ander123a at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 7

All you have to do is as follows ...

Before:

public class MyGraph extends Canvas {

public void paint(Graphics g) {

/* ... */

}

}

After:

public class MyGraph extends JComponent {

public void paintComponent(Graphics g) {

/* ... */

}

}

quittea at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...
# 8
thank you very much, it worked, tough im still trying to asimilate it
ander123a at 2007-7-7 22:19:37 > top of Java-index,Java Essentials,Java Programming...