I use a jtabbedpane. for each tab it will have a panel and some components.
to increase the performance i created a ‘n’ number of function for ‘n’ number of tabs. in that function i created components for that tabs.if the particular tab get selected i call the required function. so the component was created according to the tab selection. my question is
first we select tab1[component was created for tab1]then we change the tab from tab1 to tab2[component was created for tab2] if we again go to tab1 the component was created again. whether it affect performance? if yes.. how do i recover it?
If your re-creating the tabs each time, you’re going take a performance hit when you switch tabs. While lazy loading is a good idea, it might be preferable to cache the results; so if the tab’s content has already been created, you don’t need to recreate it again.
You will need to profile the cost in performance against the memory usage over time.