Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

First land Last card in Cardlayout  RSS feed

 
Sandesh Jadhav
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any direct way in Cardlayout to find out whether the currently displaying card is the first or the last card ?

Thanks
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No direct way; Sun decided to keep the "currentCard" field hidden from us, without a public accessor.

An indirect way:
You see, a CardLayout simply hides all non-shown cards, and only one of them is visible at a time.
 
Sandesh Jadhav
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob, it worked.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!