jPanel Dissapears

Hi All,

I have created a panl that is used as a viewer for HTML pages. I have placed a JscrollPane on the panel that has a Jeditor Pane insode of it dispalying the html.

This is all done in a null layout.

I have placed a secondary jpanel ontop of the jScrollPane to serve as a progress indicator that has a page x of y count.

when ever i click to go to the next page the Jpanel that is ontop of the JScrollPane moves behind the Scrollpane.

Does anyone know whey this is happening and posibally how to solve it. I've tried removeing and adding the obvject back onto the containing pannel on every next clcik this has not worked i also tried the same but by onlu showing and hiding the objects

thx

Werns

[752 byte] By [Wernsa] at [2007-11-27 5:30:58]
# 1
We would need more information to help you out here, e.g. how did you place the second panel on top? to which component did you add it? Posting some code often proves to be a good way of letting us find your bug.
rebola at 2007-7-12 14:55:43 > top of Java-index,Desktop,Core GUI APIs...
# 2

Hi rebol,

To give some clarity on the matter (Hope Fully)

I have a main panel call it the container panel (640 x 480).

to this panel i first added a jEditorPane which comes with a jScrollpane the editor pane is also (640 x 480).

next I added a second Panel to the container panel lets call it the information panel 640 x 24. this was added to the Container panel but it is on top of the Editor. Everything in the container panel is in a null layout allowing me to place controls on top of each other.

Now when the next page is loaded into the Jeditor pane the information panel moves behind the Jeditor Pane.

Tthx for your time on this i really appreciate it.

Wernsa at 2007-7-12 14:55:43 > top of Java-index,Desktop,Core GUI APIs...
# 3

Well, from your description it sounds that you did not properly adjust the location /size of your components. Check that out.

Second thing i'd like to say is that setting LayoutManager to null is a very very bad idea. Use Grid Bag layout instead. For more information on grid bag layout visit http://java.sun.com/developer/technicalArticles/GUI/AWTLayoutMgr/index.html#BAG

Hope this information helps you.

Swing_guya at 2007-7-12 14:55:43 > top of Java-index,Desktop,Core GUI APIs...
# 4
The last updated panel will be painted on top, that's only natural. What you need is to specify the z-order.See http://java.sun.com/developer/JDCTechTips/2005/tt0118.html for details.Hope this helps.
rebola at 2007-7-12 14:55:43 > top of Java-index,Desktop,Core GUI APIs...