Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 2990
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.
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!