Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:07:35+00:00 2026-06-02T01:07:35+00:00

In a panel, I added 3 composite public class frame { //Initialization …. ….

  • 0

In a panel, I added 3 composite

public class frame {

//Initialization
....
....
public Service service = new Service();

public frame () {
    initWidget(getFramePanel());
}

private HorizontalPanel getFramePanel() { 
    if (hp== null) {
        hp= new HorizontalPanel();
        hp.setSize("1442px", "750px");
        hp.add(getTree());// **are composites**
        hp.add(getTable()); // **are composite**

    }
    return hp;
}

What I understand is that both these tree and table are added to hp in the same class , so I can use variable or object initialized in this class, in both the composites

ex : service object is in class frame, so i want to know whethr i can use service in both the composite .

in tree and table composite. If yes then How?

this code may not be correct because I didn’t copy paste the code .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:07:36+00:00Added an answer on June 2, 2026 at 1:07 am

    You can try to use Observer pattern, create an interface that has a method to call the service, eg. “callService” and create an object “MyInterfaceImpl” that implements this interface in class “frame”. This object will implement the interface such that it will get and use both children (getTree() and getTable()) composite’s values.

    Pass this object MyInterfaceImpl to both composites, either through a constructor or a method, then you can always invoke this object MyInterfaceImpl‘s method from either composites’ UI objects’ eventHandler.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that extends JPanel. On the panel I have added an
I have just added a new panel to StatusBar1 and it is called 5
I have a class which extends JPanel, inside this panel i have added a
In GXT, I've got a control with an important panel added to the bottom
I'm trying to add a collapsible panel to a panel I added in the
I have created a JLabel lab1. Added it to a panel and added mousemotionlistener
i added checkboxes dynamically to panel. for (int intControlIndex = 0; intControlIndex < dsTagsList.Tables[0].Rows.Count;
I have added checkbox selection model to grid panel. It works fine in IE8
I have placed many widgets in the absolute panel and added the absolute panel
i am trying to move a image in picture box. i added panel to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.