Results 1 to 4 of 4
  1. #1
    atrodeyo is offline Member
    Join Date
    Apr 2012
    Posts
    41
    Rep Power
    0

    Default Access restriction message

    when I add "import com.java.swing.plaf.nimbus.NimbusLookAndFeel;" I get the following message

    "Access restriction: The type NimbusLookAndFeel is not accessible due to restriction on required library /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rt.jar"

    can anyone help me to solve this problem?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Access restriction message

    The name of this package has changed over time. In part, I think to overcome problems of access. (See, eg bug_id=6616742)

    The location is currently javax.swing.plaf.nimbus.NimbusLookAndFeel

    Oracle's Tutorial suggests you find the laf by name, with code like

    Java Code:
    import javax.swing.UIManager.*;
    
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception e) {
        // If Nimbus is not available, you can set the GUI to another look and feel.
    }
    saying "Do not set the Nimbus look and feel explicitly by invoking the UIManager.setLookAndFeel method because not all versions or implementations of Java SE 6 support Nimbus. Additionally, the location of the Nimbus package changed between the JDK 6 Update 10 and JDK 7 releases".

  3. #3
    atrodeyo is offline Member
    Join Date
    Apr 2012
    Posts
    41
    Rep Power
    0

    Default Re: Access restriction message

    I tried javax.swing.plaf. but it didnt work work me either.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: Access restriction message

    Quote Originally Posted by atrodeyo View Post
    I tried javax.swing.plaf. but it didnt work work me either.
    That wasn't what pbrockway2 suggested. Did you even read the code snippet he so generously gave you?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. eclipse , Access restriction
    By miko5054 in forum Eclipse
    Replies: 7
    Last Post: 07-17-2010, 02:52 PM
  2. Access Restriction error
    By kraut in forum New To Java
    Replies: 2
    Last Post: 06-19-2010, 01:29 AM
  3. Access Restriction error
    By kraut in forum Eclipse
    Replies: 0
    Last Post: 06-19-2010, 01:07 AM
  4. Replies: 7
    Last Post: 02-19-2010, 11:03 AM
  5. Error: Access restriction
    By livnihai in forum Eclipse
    Replies: 1
    Last Post: 11-25-2009, 06:53 PM

Posting Permissions

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