JLayeredPane issues?!

in my GUI class i have a Frame that holds a Jpanel which holds another JPanel and a JLayeredPane. the jpanel which calls "MenuPanel" works fine, but the JLayeredPane which calls "DP" wont show up. any suggestions on how to fix this error?

Re: JLayeredPane issues?!

Re: JLayeredPane issues?!

Hey. Thanks for the response. I know it doesnt work because I should see the label ”test” from the Dpanel class. instead, I just see an empty panel. I even tried adjusting the z index, didnt work. Any ideas?

Re: JLayeredPane issues?!

if you uncomment line 35, the DPANEL should be shown in the JLayeredPane named "DataPanel". however i commented it out just to see if the layeredpane is working without calling another class by using line 31. however, that Jlabel isnt even output to the screen

Re: JLayeredPane issues?!

I havent gotten it to display at all. it seems JPanels will display without any issues, but JLayeredPanes wont show. im trying something now. im going to post it up in a few and let you know what happens

Re: JLayeredPane issues?!

AHA!

i went through the tutorial a thousand times (exaggeration), but i found the error. My DPanel class was missing all sorts of stuff. i needed to set the layout since JLayeredPanes dont automatically have a layout manager., then i needed to create the image as an icon, and set the icon as a JLabel. then i had to add a frame with a JComponent and add the DPanel to it and then finally it worked, somewhat. lol the code for the DPanel is:

so it works, such that i see output on the screen. However, my image cant be found. i get the flags as coded "System.err.println("background icon not found; using black square instead.");" and System.err.println("Couldn't find file: " + path);. the black square is shown where the image is supposed to be. ive moved the location of "background5.jpg" countless times and my app still cant find it. any suggestions?