Thread: FAIL adding shops. Compile error I've fixed most but need help with this.

Results 1 to 8 of 8
  1. #1 FAIL adding shops. Compile error I've fixed most but need help with this. 
    Donator

    Scim's Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    739
    Thanks given
    61
    Thanks received
    16
    Rep Power
    238
    Code:
                    Errors
    .\net\com\shops\Shopbuyconfig.java:32: orphaned case
                    case 197: //bandit
                    ^
    .\net\com\shops\Shopbuyconfig.java:89: class, interface, or enum expected
    }next go to →
     ^
    .\net\com\io\PacketManager.java:18: cannot access net.com.shops.Shopbuyconfig
    bad class file: .\net\com\shops\Shopbuyconfig.java
    file does not contain class net.com.shops.Shopbuyconfig
    Please remove or make sure it appears in the correct subdirectory of the classpa
    th.
    import net.com.shops.Shopbuyconfig;
                        ^
    Reply With Quote  
     

  2. #2  
    Registered Member Glabay's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,212
    Thanks given
    141
    Thanks received
    55
    Discord
    View profile
    Rep Power
    455
    show me the code with the case befor and after it
    PI * 13.37 = 42
    There are 10 kinds of people; those who know Binary and those who don't
    Why programmers confuse Christmas and Halloween; Because 31 OCT = 25 DEC.
    Reply With Quote  
     

  3. #3  
    Donator

    Scim's Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    739
    Thanks given
    61
    Thanks received
    16
    Rep Power
    238
    Code:
     if (p == null || p.stream == null) {
                return;
            }
    		
    		PlayerItems pi = new PlayerItems();
    		NPCOption1 N1 = new NPCOption1();
    		case 197: //bandit
    		p.viewings = 1;
    		p.shopid = 2;
    		p.frames.showInterface(p, 278);
    		p.frames.setItems(p, 278, 89, 94, p.shop2, p.shop2n);
    		p.frames.setString(p, "                                               <col=ffffff><img=1>God Range Armor Shop<img=0>", 278, 88);
    
    		break;
    		case 198: //fancy
    		p.viewings = 1;
    		p.shopid = 4;
    		p.frames.showInterface(p, 278);
    		p.frames.setItems(p, 278, 89, 94, p.shop4, p.shop4n);
    		p.frames.setString(p, "                                         Fancy shop", 278, 88);
    		break;
    Reply With Quote  
     

  4. #4  
    Registered Member Glabay's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,212
    Thanks given
    141
    Thanks received
    55
    Discord
    View profile
    Rep Power
    455
    in order to use the case you would need something like




    Code:
    switch(/*ShopID or NpcID*/) {
        case 197:
    you need the switch not an if statement
    PI * 13.37 = 42
    There are 10 kinds of people; those who know Binary and those who don't
    Why programmers confuse Christmas and Halloween; Because 31 OCT = 25 DEC.
    Reply With Quote  
     

  5. #5  
    Donator

    Scim's Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    739
    Thanks given
    61
    Thanks received
    16
    Rep Power
    238
    Code:
                    Errors
    .\net\com\io\PacketManager.java:25: cannot access net.com.shops.Shopbuyconfig
    bad class file: .\net\com\shops\Shopbuyconfig.java
    file does not contain class net.com.shops.Shopbuyconfig
    Please remove or make sure it appears in the correct subdirectory of the classpa
    th.
            public Shopbuyconfig shopbuyconfig = new Shopbuyconfig();
                   ^
    thats what i get now
    Reply With Quote  
     

  6. #6  
    Registered Member Glabay's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,212
    Thanks given
    141
    Thanks received
    55
    Discord
    View profile
    Rep Power
    455
    fix the import?
    PI * 13.37 = 42
    There are 10 kinds of people; those who know Binary and those who don't
    Why programmers confuse Christmas and Halloween; Because 31 OCT = 25 DEC.
    Reply With Quote  
     

  7. #7  
    Donator

    Scim's Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    739
    Thanks given
    61
    Thanks received
    16
    Rep Power
    238
    how i tried it goes to the right directory
    Reply With Quote  
     

  8. #8  
    Registered Member lildude783's Avatar
    Join Date
    Jan 2010
    Age
    25
    Posts
    379
    Thanks given
    13
    Thanks received
    7
    Rep Power
    3
    make sure the class you import is public not private and make sure the thing has a package..

    like package net.com.shops;

    then put an import net.com.shops.*;

    it should fix it up.
    Quote Originally Posted by Hunter
    Here in America, we dont use the metric system, we use freedom units!
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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