This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello world, I am writting a stock controlling program using swing. I have a JTabbedPane and have so many different tabs for example "Logging, Searching , Addint data to the database ,Biiling " etc. What I want to know is.. is it ok if i write all the coding for every tab in a single class.?. if it is not the way, do i have to write a class for each and every tab?. If it is so how can i link all the classes to appear in a JTabbedPane. Please tell me what to do. If i should use different classes please write down the structure i should follow. Another question if I use different classes will I be able to access each and every variable where ever I want. Thanks
SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
I personally would have a separate class for each tab. Each pane of the JTabbedPane would contain one instance of each of your classes. Another question if I use different classes will I be able to access each and every variable where ever I want. As long as you hold references to the instances of each tab this should not be a problem.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Sep 29, 2000
Please do not cross post. Continue the conversation here.