Home arrow static arrow Java Programming [Archive] - getting data form tabbedPane
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - getting data form tabbedPane
This topic has 2 replies on 1 page.

Posts:27
Registered: 5/24/04
getting data form tabbedPane  
Jun 29, 2004 6:47 AM



 
Hi!
I have dialog with JTabbedPane, it contains several tabs, after pressing OK, I want to get all data from
JPanels in Tabs.

how can I get JPanel from every Tab?

I mean

tabbedPane.addTab(String str , icon, JPanel PANEL1, String sttr1);

I want to get access to PANEL1. somethins like JPanel panel = tabbedPane.getTab(1);

 

Posts:1,135
Registered: 1/16/04
Re: getting data form tabbedPane  
Jun 29, 2004 7:05 AM (reply 1 of 2)



 
Where did you get the method getTab() from...

Check the API's for JTabbedPane...

and you will find a method called... getComponentAt()

read the API's for proper syntax and usage...

- MaxxDmg...

- ' He who never sleeps... '
 

Posts:957
Registered: 3/31/04
Re: getting data form tabbedPane  
Jun 29, 2004 7:06 AM (reply 2 of 2)



 
Guessing here but sounds like it might be more effective to make a template panel class for each panel and then add some kind of getData() method which returns whatever you want, like a object array or something?
Then you could do Object[] = panel1.getData()

Something like that possibly?? :-P

There's a good four part tutorial about building a java application that (almost) covers this.
 
This topic has 2 replies on 1 page.