Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTabbedPane.getTabComponentAt(int) is not working

 
guenter porzer
Greenhorn
Posts: 2
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,

I'm trying to iterate over all tabs in a JTabbedPane but somehow getTabComponentAt always resturns null.
I suppose I made a mistake but I can't find it.

here an example :



The output of this example is (see below) since all calls to getTabComponentAt return null ?


I have expexted after adding Components via addTab I could retrieve the Component via getTabComponentAt.

Any ideas ?

best regards
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getTabComponentAt returns the component that is used for rendering the tab itself. For the content of the tab, use getComponentAt instead.
 
guenter porzer
Greenhorn
Posts: 2
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, works like a charm !

best regards
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic