Bascially, I'm in a bit of a pickle due to the way I've structured my program and the way java handles tabs in an application.
The program has two tabbed panes, in the first of the tabbed panes I've got a String Array being generated *after* the user and program has performed a number of actions on the input they enter on that pane.
All dandy so far.
However, what I need is that array to be accessible from within the 2nd panel, and for the life of me I can't think how to access it due to it being buried a couple of levels down in the first panel.
Program structure:
Main.java -> GuiTabs.java -> LexPanel (the string [] is in here)
-> SynPanel (I need to use the array here after it's been filled with data from the LexPanel).
There's also a Token class which isn't linked but used by both.
As a return value in a public get method in LexPanel. I could define it as a seperate public String[] inside the LexPanel class, but that's not the issue.
Currently I access the get and set methods in GuiTabs, using the instances of LexPanel and SynPanel, which is fine incidently, however obivously it only runs that at compilation and not whenever I need it to at run time.
I was hoping I could just call a parent method from the SynPanel instance seeing as java doesn't do object by reference, but looking at it, I might be able to pull some checks to do with the focus of the panels and just call it then.
Well, I've manged to get the information I need across, as noted by my extremely dodgy use of JOptionPanes in the debugging process.
The JList doens't want to update properly, but that's a minor issue and I'm sure I can make it bend to my will.
As a note, I ended up sending the instance of the LexPanel class into the SynPanel when I initialised it a few lines down. I get the data, it's all that matters.