Results 1 to 8 of 8
  1. #1
    Tikasas is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default compiling problems.

    hi. im new in java . I use eclipse. I tried to write a script with a tutorial. the script sude show some pictures when one of the icon is pressed and stuff. It needed some other stuff like HotSpot.class files.. i tried to import em and i did everythings good (i think) . But when i compile it gives me an error :


    Client.java:5: Client is not abstract and does not override abstract method startup{} in Loadable
    public class Client extends Applet implements Loadable, HotSpotListener{

    thank you for youre answers

  2. #2
    Pac88 is offline Member
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    0

    Default

    I think, it's useful if you post your source code.

  3. #3
    Tikasas is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    Java Code:
    import java.applet.*;
    import java.awt.*;
    
    
    public class Client extends Applet implements Loadable, HotSpotListener { 
    
    	RealMedia rm;
    	HotSpot b1,b2,b3;
    	
    	int x=1;
    	
    	public void init (){
    		setLayout(null);
    		rm=new RealMedia(this);
    		rm.add("inventorydat.gif","inventory");
    		rm.add("statusdat.gif","status");
    		rm.add("settoingsdat.gif","settings");
    		rm.add("inventory.gif");
    		rm.add("inventory2.gif");
    		rm.add("settings.gif");
    		rm.add("settings2gif");
    		rm.add("stats.gif");
    		rm.add("stats2.gif");
    		
    		rm.load();
    	}
    	
    	public void startUP (){
    		
    		b1=new HotSpot(this);
    		
    		b1.setImage(rm.get("inventory.gif"),1);
    		b1.setImage(rm.get("invetnory2.gif"),2);
    		b1.setBounds(70,60,0,340);
    
    		
    		b2=new HotSpot(this);
    		
    		b2.setImage(rm.get("stats.gif"),1);
    		b2.setImage(rm.get("stats2.gif"),2);
    		
    		
    		b3=new HotSpot(this);
    		
    		b3.setImage(rm.get("settings.gif"),1);
    		b3.setImage(rm.get("settings2.gif"),2);
    		
    		add(b1);
    		add(b2);
    		add(b3);
    		
    		b1.repaint();
    		b2.repaint();
    		b3.repaint();
    		
    	}
    	
    	public void paint(Graphics g){
    		
    		g.setColor(Color.white); 
    		
            if (!rm.isLoaded())  
            { 
                g.drawString("loading file "+rm.getCurrent(),20,20); 
                 g.drawString("of "+rm.getTotalFiles(),20,40);    
                 g.drawString("Percent: "+rm.getPercent(),20,60);    
                 g.fillRect(20,80,rm.getPercent(),20);    
            } 
            
            else{
            	if(x==1)
            		g.drawImage(rm.get("inventorydat.gif"),0,170,this);
            	if(x==2)
            		g.drawImage(rm.get("statusdat.gif"),0,170,this);
            	else
            		g.drawImage(rm.get("settingsdat.gif"),0,170,this);
            }
            
    	}
    	{
    		if(b1==b2)
    			x=1;
    		if(b2==b3)
    			x=2;
    		else
    			x=3;
    		repaint();
    	
    	}
    	  public Image loadImage(String file)  
    	     { 
    	            return getImage(getCodeBase(),file); 
    	      }
    	   public AudioClip loadAudio(String file)  
    	     { 
    	            return getAudioClip(getDocumentBase(),file); 
    	     }  
    
    	
    }

  4. #4
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    10

    Default

    the compiler is telling you that you didn't implement the "startup" method that you have to.

  5. #5
    Tikasas is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    how do i fix it? please help.. :)

  6. #6
    Tikasas is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    now it says : Client.java:5: Client is not abstract and doesn not override abstract method hotSpotEvent(HotSpot) in HotSpotListener
    public class Client extends applet implements Loadable, HotSpotListener

    EDIT:

    everythings fine now. i Compiled it Succesfully..

    now, i tried to open the applet with html file couse i don't know how to open otherway. and when i open it. the page is blank. nothing. any suggestions ? please.
    Last edited by Tikasas; 04-13-2009 at 10:53 PM.

  7. #7
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    10

    Default

    then override it.
    add a method hotSpotEvent(HotSpot) to your code.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  8. #8
    Tikasas is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    everythings fine now. i Compiled it Succesfully..

    now, i tried to open the applet with html file couse i don't know how to open otherway. and when i open it. the page is blank. nothing. any suggestions ? please.

Similar Threads

  1. Replies: 2
    Last Post: 03-20-2009, 11:58 AM
  2. note while compiling
    By j2vdk in forum New To Java
    Replies: 3
    Last Post: 09-04-2008, 12:52 AM
  3. Compiling error
    By lawksalih in forum New To Java
    Replies: 6
    Last Post: 01-29-2008, 08:26 PM
  4. I have 3 errors after compiling
    By coco in forum JDBC
    Replies: 2
    Last Post: 10-18-2007, 10:32 AM
  5. problems when compiling
    By valery in forum New To Java
    Replies: 2
    Last Post: 07-25-2007, 08:35 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
  •