This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have a problem that made me to spend 20hrs with no luck. Here is the problem. I have a program with 3 classes. Main, ClassA, ClassB. Main Class is just a simple main method to load JFrame in class A. In class A I got a JList and a JButton. So whenever I press this button, it loads Class B. In class B I got another button that its job is to add items to the JList in ClassA. Let's say when ever I press that button, it does Button.addElement("Item");
I made the layout but the problem is because they are in separate classes they cant link well. I guess I could not pass the instance. Anyway here is the code for each class:
So when I press the add button in classB it gives lots of errors and basically doesn't work. Any idea?