Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Display button on top of JScrollPane Java Swing

 
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: 3191
29
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic