This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing objects

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone move this topic to the AWT/Swing folder?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if you promise to solve the problem.
 
Dirk Schreckmann
Sheriff
Posts: 7023
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic