This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Program Structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Program Structure

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
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)
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Please do not cross post. Continue the conversation here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Program Structure
 
Similar Threads
programe structure
The programe structure
Program Structure
program sturcture
Program Structure