How to get GUI panels out of another class?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to get GUI panels out of another class?

  1. #1
    Join Date
    Jan 2005
    Posts
    61

    How to get GUI panels out of another class?

    I'm working on a little app that has several Product classes, and a sort of "manager" class. Each product class has a range of GUI panels, eg "Add New Product Panel", and "Edit Product Panel".

    What I want to do is call these panels from the "manager" class - so for example, if the user clicks the "edit product" button, the edit product panel is opened up in the main content pane.

    I'm having a bit of a battle with it - I want to keep the panels in their corresponding classes, but it seems that doing it that way, my only option is to make each panel a method, so I can call that method from the manager class. That leasds to a host of problems which I won't go into, but I'd appreciate any ideas on a better way to do it.

  2. #2
    Join Date
    Oct 2004
    Posts
    311
    The usual way for geting objects from other classes is with the use of getter methods. so in your case that would be a method similar to getEditProductPanel, with the necessary parameters. Once you are done with the panel, and have entered all the data that needs entering, you can put it back in the editProject object via a setter method, setEditProductPanel. This method would then be responsible for handling all the data entered into the panel.

    Mark

  3. #3
    Join Date
    Jan 2005
    Posts
    61
    Ah, that's basically the set up I had - I just wondered if I was going a bit off the rails. THanks for the reply, I can crack on now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center