File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Passing objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Passing objects" Watch "Passing objects" New topic

Passing objects

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hi. I have created two classes that extend JPanel. These JPanels are placed on a JTabbedPane. One of these classes represents a 'Project Maintenance' tab. The other represents an 'Order Maintenance' tab. These two classes each have a combo box on them that contains project ID's. I want to be able to re-populate the data in this combo box on the order maintenance tab whenever a user has pressed the save button on the project maintenance tab, and there were no errors.
The main class that creates the JTabbedPane, also creates the ProjectMaintenance class and the OrderMaintenance class. I thought I could just pass OrderMaintenace into ProjectMaintenance, and access it that way, but I get a runtime error when I do this. (ClassNotFoundException). In the code, OrderMaintenance is created before ProjectMaintenance so I thought it should recognize it. However, if I switch the order that these two classes are added to the JTabbedPane it works. But I don't want OrderMaintenance before ProjectMaintenance on my TabbedPane.
Does anyone know of a way I can do this?
Here is the code for my main class..

Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Could someone move this topic to the AWT/Swing folder?

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Only if you promise to solve the problem.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

ClassNotFoundException means that the JDK cannot find the class you have specified... sounds like a package name problem or misspelling. If the JDK finds the class, but the reference is bad, you would get a NullPointerException.

Look in the stacktrace of the exception to see what class and line the exception is being thrown on...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Passing objects
It's not a secret anymore!