aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTabbedPane.getTabComponentAt(int) is not working  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTabbedPane.getTabComponentAt(int) is not working  " Watch "JTabbedPane.getTabComponentAt(int) is not working  " New topic
Author

JTabbedPane.getTabComponentAt(int) is not working

guenter porzer
Greenhorn

Joined: Apr 04, 2012
Posts: 2

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

Joined: Oct 27, 2005
Posts: 19692
    
  20

getTabComponentAt returns the component that is used for rendering the tab itself. For the content of the tab, use getComponentAt instead.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
guenter porzer
Greenhorn

Joined: Apr 04, 2012
Posts: 2

thanks, works like a charm !

best regards
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTabbedPane.getTabComponentAt(int) is not working