Posted on 2004-11-26
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)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);
            //frame.getContentPane().add(top, BorderLayout.NORTH);
        getContentPane().add(pane, BorderLayout.CENTER);
        setTitle("Electronic Auction System - CLIENT");
Question by:tom_mk
    1 Comment
    LVL 92

    Accepted Solution

    make your tabbed pane a member var and add a method to access it:

    public JTabbedPane getTabs()
       return pane;

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    VB Script 3 61
    pairstar challenge 2 26
    mapShare challenge 13 43
    @SBGen Method 3 18
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues undeā€¦
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    The viewer will learn how to implement Singleton Design Pattern in Java.

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now