Results 1 to 3 of 3
  1. #1
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,066
    Rep Power
    8

    Default inaccessable class or interface

    -In the Main class,
    calpanel is an object of the class CalendarPanel:
    CalendarPanel calpanel = new CalendarPanel();


    -CalenderPanel has an inner class:

    Java Code:
     private class PanelData { // the year array for each day
            private JPanel panelreference;
    
            public void setPanelRef(JPanel pr)  {
                    panelreference = pr;
                }
            public JPanel getPanelRef()  {
                    return panelreference;
                }
    
        }
    
     PanelData paneldata = new PanelData[370]; // initialize day panel data array
                for (int i = 0; i < paneldata.length; i++) {
                        paneldata[i] = new PanelData();
                }
    -Now when I say in the Main class:
    Java Code:
    for (int ii = begindate; ii < enddate; ii++) {
                        calpanel.paneldata[i].getPanelRef().setBackground(colorset2);
     }
    -the compiler protests and says: "is an inaccessable class or interface"
    What might be the reason of this protest?

  2. #2
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,066
    Rep Power
    8

    Default Re: inaccessable class or interface

    OOOOHJEEEEE

    I see it right away the inner class is private!

  3. #3
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: inaccessable class or interface

    make your inner class public or default

Similar Threads

  1. Replies: 1
    Last Post: 07-08-2012, 05:23 PM
  2. When to use Abstract class and Interface?
    By vivekjan17 in forum New To Java
    Replies: 1
    Last Post: 03-05-2012, 10:37 AM
  3. Replies: 15
    Last Post: 02-04-2012, 11:15 PM
  4. Replies: 14
    Last Post: 05-28-2009, 05:44 AM
  5. Replies: 0
    Last Post: 04-02-2008, 07:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •