Okay so I have a class called Main which calls the draw class into a panel(works). Also in the main class I have a file opener to which the file is needed to read in the format class(works). This format class has info the draw class needs. How can I do this? I tried making a method to return the format class info, but I have to do Main main = new Main(); in the draw class which causes an infinite loop. So essentially I only need the format class data, how can I pas it along? I tried static also(not sure how static works fully either).
Im thinking this is important in a lot of things.... if I don't make 100% sense I will post some code.
The only thing I can think of is having a central class for storing everything in case some classes need others especially the data coming into the "main" class.... Maybe I will do that, so that way I only need the data and don't care about the rest of the class and if I do care I will have it called. I could also have another class for this one thing and maybe this might be a one time occurrence.
I forgot to mention that I believe I figured out the issue.
Class 1 Main is a Jframe and calls Draw which extends JPanel...
Draw needed the information in the format class to work.
Main has the menus which the "Open" menu is for selecting files. These files are read and then set into the format class. Once that's done I have to call it in the Draw Class. Now I realized I could just make a Constructor of Draw to read in the Format classes information and/or the file. I was really tired when I was doing this, and figured it out later in the day :P.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How to transfer data when the 1st class calls the 2nd and 3rd, and the 2nd needs the 3rd.