?
Solved

OBject ACCESS

Posted on 2004-11-26
1
Medium Priority
?
170 Views
Last Modified: 2010-03-31
hi im working on a file A.....
my question is how can i access an object "JTabbedPane pane " which is located in file B.

file A and file B are in the same package.

my file B is:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
public class ClientFrame extends JFrame
{

      public static BidPanel bid = new BidPanel();
      public static BrowsePanel browse = new BrowsePanel();
      public static RegisterPanel register = new RegisterPanel();
      public static UserAccountPanel userAccount = new UserAccountPanel();
      public static PostAdPanel postAd = new PostAdPanel();
    public static clientlogin login  = new clientlogin();

      private ServerServices easServices;

      public ClientFrame(ServerServices easServices)
      {
            this.easServices = easServices;
            
      
            JFrame frame = new JFrame("Electronic Auction System - CLIENT");
            
            
            JTabbedPane pane = new JTabbedPane();
            
            pane.add((JPanel)login,"LogIn",0);
            pane.add((JPanel)register, "Register Panel",1);
            pane.add((JPanel)bid, "Bidding Panel",2);
            
            pane.add((JPanel)browse, "Browse Panel",3);
            pane.add((JPanel)userAccount, "User Account Panel",4);
            pane.add((JPanel)postAd, "Post Ads Panel",5);
            
            //pane.setEnabledAt(1,false);
            pane.setEnabledAt(2,false);
            pane.setEnabledAt(3,false);
            pane.setEnabledAt(4,false);
          pane.setEnabledAt(5,false);
            
            //pane.setSelectedIndex(1);
            
            
            //****************************************************************
            
            //frame.getContentPane().add(top, BorderLayout.NORTH);
        getContentPane().add(pane, BorderLayout.CENTER);
        setSize(800,800);
        setTitle("Electronic Auction System - CLIENT");
            
            
      }
            
}
0
Comment
Question by:tom_mk
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 12684354
make your tabbed pane a member var and add a method to access it:

public JTabbedPane getTabs()
{
   return pane;
}
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question