Results 1 to 3 of 3
  1. #1
    Macca07 is offline Member
    Join Date
    Nov 2008
    Posts
    9
    Rep Power
    0

    Default GameImpl is not abstract and does not override abstract method

    hey, i'm doing an RMI project with factory callback, and i'm getting this error. i can't see any typos so don't think thats a problem, just can't figure it out, will post relevant code and leave out a lot of unnecessary code

    import java.rmi.*;
    import java.rmi.server.*;

    import java.awt.*;
    import java.awt.event.*;
    import java.io.Serializable;
    import javax.swing.*;
    import java.util.Random;

    public class GameImpl extends UnicastRemoteObject implements Game
    {
    class NewGame implements Game, Serializable
    {
    public ItemPlay21 getPlay21()
    {
    return new playGame21();
    }

    public class playGame21 implements ItemPlay21, Serializable
    {
    public transient JPanel panel;

    public JComponent getGUI()
    {
    panel = new JPanel();
    panel.setLayout(new GridLayout(2,2));

    return panel;
    }

    class play21Gui implements ActionListener
    {
    public JFrame mainFrame;
    public JTextArea display;
    public JButton play, exit;
    public JPanel controlPanel, displayPanel, play21Panel;
    public ItemPlay21 play21;

    public Random randomNumbers = new Random();

    NewGame Game = new NewGame();

    play21Gui runner = new play21Gui(Game.getPlay21());


    public play21Gui(ItemPlay21 new21Game)
    {
    play21 = new21Game;
    runner.createGui();
    }

    public void createGui()
    {
    mainFrame = new JFrame("Assignment One");
    Container content = mainFrame.getContentPane();
    content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));

    play21Panel = new JPanel();
    play21Panel.add(play21.getGUI());
    content.add(play21Panel);

    displayPanel = new JPanel();
    display = new JTextArea(10, 40);
    display.setEditable(false);
    displayPanel.add(display);
    content.add(displayPanel);

    controlPanel = new JPanel();
    play = new JButton("Play");
    exit = new JButton("Exit");
    controlPanel.add(play);
    controlPanel.add(exit);
    content.add(controlPanel);

    play.addActionListener(this);
    exit.addActionListener(this);

    mainFrame.addWindowListener(new WindowCloseManager());
    mainFrame.pack();
    mainFrame.setVisible(true);
    }

    public void actionPerformed(ActionEvent evt)
    {
    Object originator = evt.getSource();
    if (originator == play)
    {
    playGame();
    }
    else if (originator == exit)
    {
    exitApplication();
    }
    }
    }



    import java.awt.*;
    import java.awt.event.*;
    import java.io.Serializable;
    import javax.swing.*;
    import java.util.Random;

    public interface Game extends java.rmi.Remote
    {
    public ItemPlay21 getPlay21() throws java.rmi.RemoteException;
    }

    interface ItemPlay21
    {
    public JComponent getGUI();
    }


    If anyone needs to look at Client or Server code just let me know

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Seemingly, either UnicastRemoteObject or Game, declare some methods that the extending/implementing class is suppossed to define, and you haven't done so.

  3. #3
    racerxadam is offline Member
    Join Date
    Jul 2008
    Posts
    68
    Rep Power
    0

    Default

    where is the code for UnicastRemoteObject and/or Game?

    Please post your code in code tags to make it readable.

Similar Threads

  1. Replies: 2
    Last Post: 03-26-2010, 06:12 PM
  2. Replies: 6
    Last Post: 10-27-2008, 01:25 AM
  3. Abstract class
    By naeem.jamil in forum New To Java
    Replies: 4
    Last Post: 08-26-2008, 06:21 AM
  4. GUI for Abstract...
    By judepereira in forum AWT / Swing
    Replies: 0
    Last Post: 01-04-2008, 09:40 AM
  5. Overiding an abstract method
    By eva in forum New To Java
    Replies: 5
    Last Post: 01-03-2008, 05:29 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
  •