This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Display button on top of JScrollPane Java Swing  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to display the Down button on top of the JscrollPane-JTable to scroll to the last cell like in the messengers

I tried to use OverlayLayout, but when I add code

popupPanel is not displayed
How to force popupPanel to be displayed over JScrollPane?

all code
 
Rancher
Posts: 3014
20
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing paints components in their ZOrder, which by default basically mean they are painted in the  reverse order that they are added to the panel.

This is not usually an issue when components are displayed in 2 dimensions.

But when trying to overlay components it is important.

So your code should be something like:


Check out Overlap Layout for more information on how ZOrder works.
 
Pavel Chickoff
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Camick wrote:Swing paints components in their ZOrder, which by default basically mean they are painted in the  reverse order that they are added to the panel.

This is not usually an issue when components are displayed in 2 dimensions.

But when trying to overlay components it is important.

So your code should be something like:


Check out Overlap Layout for more information on how ZOrder works.



It works, thank you very much.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!