Bookmark Topic Watch Topic
  • New Topic

Program Structure

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross post. Continue the conversation here.
 
    Bookmark Topic Watch Topic
  • New Topic