Introduce My Client-Server Applet RPG Called EsperHunter

Hi, my name is Yudhi Kurniawan.
I have developed a client-server applet game which I called it EsperHunter project.
It's a client-server Java applet Role Playing Game application.
It's not like common applet games which are stand-alone games. It use server application for
login player, getting its world and story, saving and loading playing status.
It's not a multiplayer RPG, but as player you will find the interesting thing that the world
of game and story will grow up continously or changed because its administrator can update
or change the world and story of the game. You will find out how it's working at my documentation page.
But I have a problem to launch that application in actual web because it's difficult to find
web hosting which I can launch my server game application there. For now, my application is
reliable for LAN development.
You can download and try my application at my site at :
http://members.fortunecity.com/yudhi97
I really need a solution to solve this problem. As fellow of Java programmer, I hope that we
can join a bussiness together to develop Java game application.
Thank you for your attention.

i'm not downloading all of that. that server sucks ass. i hate all those pop ups. i don't want to install and run any of that shite. maybe you should store all your files in a jar file

Similar Messages

  • Client/server, applet/server

    Hi
    I have a question about server/client programming in java.
    I have been programming a shortest path algorithm, but it takes to long time to rune this peace of code on the client. So I want to move it to the server.
    The client is an applet but also a java program that runs on another computer.
    How can I (the simples way) place the algorithm on the server and then call on it from the applet but also from the java program. I also want to send some data from the applet/client to the server, and then the server returns the processed information.
    This don�t have to be 100% secure, easy and fast is better : )
    (I only write it for my own learning)
    I found something that use COBRA but is this necessary?
    If you have I would like some sample code, but a url that handles the problem would be excellent.
    Best regards,
    Anders Sandholm

    to applet client and server comunication you can use this:
    from Applet To Server write this
    private static String servletUri = new String("/myApp/Servlet");
    private static String host = new String("localhost");
    private static int port = 8080;      
    //Sen data to server
    URL dataURL = new URL("http",host, port, servletUri);
    URLConnection con = dataURL.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);                    
    //Send data
    Serializable obj = "send this";
    ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(con.getOutputStream()));
    out.writeObject(obj);
    out.flush();
    out.close();                              
    //get a Server aswer
    ObjectInputStream din = new ObjectInputStream(new GZIPInputStream(con.getInputStream()));
    String data;
    data=(String)din.readObject();                    
    din.close();     
    ===================================================================
    from Servlet (on server) to applet
         ObjectInputStream din = new ObjectInputStream(new GZIPInputStream(req.getInputStream()));
         String data;
         data=(String) din.readObject();
         din.close();                              
    //... do anything
    //send client answer
    Serializable obj = "result";
    ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(res.getOutputStream()));
    out.writeObject(obj);
         out.close();     

  • Oracle form 6i in client server mode to call web service

    Hi,
    I am using oracle form 6i running in client server mode. My database version is 8.1.7.4. Now I am required to call an external web service. Is it possible to call web service without the existence of application server or web server? Please help!

    I have tried the method illustrated by the Form 10g Demo. However, when I select the Import Java Classes from the pull down menu, I have got the following error:
    PDE-UJI002 Unable to find the required Java Importer Classes.
    My Oracle Form version is as follows:
    Forms [32 Bit] Version 6.0.8.19.2 (Production)
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - 64bit Production
    Oracle Toolkit Version 6.0.8.19.1 (Production)
    PL/SQL Version 8.0.6.3.0 (Production)
    Oracle Procedure Builder V6.0.8.17.0 Build #863 - Production
    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
    Oracle Query Builder 6.0.7.1.0 - Production
    Oracle Virtual Graphics System Version 6.0.5.38.0 (Production)
    Oracle Tools GUI Utilities Version 6.0.8.11.0 (Production)
    Oracle Multimedia Version 6.0.8.18.1 (Production)
    Oracle Tools Integration Version 6.0.8.18.0 (Production)
    Oracle Tools Common Area Version 6.0.8.18.0
    Oracle CORE Version 4.0.6.0.0 - Production
    Please help !

  • Client server applet question

    Hello I have a client and server program on computer a and computer b.
    I want a webpage with a java applet.
    I want that if I push a button in the client the java applet gets a message.
    I want that the server looks for changes in the applet and when there is a change the server does something.
    I have a program where the client and server communicate with eachother but how can I make a program like I want?
    How can I send a message to the applet(on a webpage) from the client and how can I look at the applet with my server??

    Aplet runs on client side (in other words on PC which is used to view page). On server side it is stored only as any other kind of file. To be able to create "client-server" solution you have to be able to run code also on server machine. I did not found any free hosting server which allows to run java. But in many cases they allow to use PHP which runs enteirly on server side. Check for this - it may be right solution for you.

  • Applet socket problem in client-server, urgent!

    Dear All:
    I have implemented a client server teamwork environment. I have managered to get the server running fine. The server is responsible for passing messages between clients and accessing Oracle database using JDBC. The client is a Java Applet. The code is like the following. The problem is when I try to register the client, the socket connection get java.security.AccessControlException: access denied(java.net.SocketPermission mugca.its.monash.edu.
    au resolve)
    However, I have written a Java application with the same socket connection method to connect to the same server, it connects to the server without any problem. Is it because of the applet security problem? How should I solve it? Very appreciate for any ideas.
    public class User extends java.applet.Applet implements ActionListener, ItemListener
    public void init()
    Authentication auth = new Authentication((Frame)anchorpoint);
    if(auth.getConnectionStreams() != null) {
    ConnectionStreams server_conn = auth.getConnectionStreams();
    // Authenticates the user and establishes a connection to the server
    class Authentication extends Dialog implements ActionListener, KeyListener {
    // Object holding information relevant to the server connection
    ConnectionStreams server_conn;
    final static int port = 6012;
    // Authenticates the user and establishes connection to the server
    public Authentication(Frame parent) {
    // call the class Dialog's constructor
    super(parent, "User Authentication", true);
    setLocation(parent.getSize().width/3, parent.getSize().height/2);
    setupDialog();
    // sets up the components of the dialog box
    private void setupDialog() {
    // create and set the layout manager
    //Create a username text field here
    //Create a password text field here
    //Create a OK button here
    public void actionPerformed(ActionEvent e) {
    authenticateUser();
    dispose();
    // returns the ConnectionStreams object
    public ConnectionStreams getConnectionStreams() {
    return(server_conn);
    // authenticates the user
    private void authenticateUser() {
    Socket socket;
    InetAddress address;
    try {
    // open socket to server
    System.out.println("Ready to connect to server on: " + port);
    socket = new Socket("mugca.its.monash.edu.au", port);
    address = socket.getInetAddress();
    System.out.println("The hostname,address,hostaddress,localhost is:" + address.getHostName() + ";\n" +
    address.getAddress() + ";\n" +
    address.getHostAddress() + ";\n" +
    address.getLocalHost());
    catch(Exception e) {
    displayMessage("Error occured. See console");
    System.err.println(e);
                                  e.printStackTrace();
    }

    Hi, there:
    Thanks for the help. But I don't have to configure the security policy. Instead, inspired by a message in this forum, I simply upload the applet to the HTTP server (mugca.its.monash.edu.au) where my won server is running. Then the applet is download from the server and running fine in my local machine.
    Dengsheng

  • How to get started on java applet client/server game?

    Hi,
    I've googled, but didn't find any useful information about creating java applet client/server game. I've followed the example of Client/Server Tic-Tac-Toe Using a Multithreaded Server in Java How to Program from Deitel, but I when I tried on Applet, my cliet doesn't communicate with the server at all. Any help to get started with Applet would be great. Thanks!

    well, i decided to put in portion of my codes to see if anyone can help me out. the problem I have here is the function excute() never gets called. here is my coding, see if you can help. Notice, I'm running this on Applet thru html page. This shouldn't be much different than running JFrame in term of coding right?
    Server.java
        public void init()
            runGame = Executors.newFixedThreadPool(2);
            gameLock = new ReentrantLock();
            otherPlayerConnected = gameLock.newCondition();
            otherPlayerTurn = gameLock.newCondition();
            players = new Player[2];
            currentPlayer = Player1;
            try
                server = new ServerSocket(12345, 2);
            catch (IOException ie)
                stop();
            message = "Server awaiting connections";
        public void execute()
           JOptionPane.showMessageDialog(null, "I'm about to execute!", "Testing", JOptionPane.PLAIN_MESSAGE);
            for(int i = 0; i < players.length; i++)
                try
                    players[i] = new Player(server.accept(), i);
                    runGame.execute(players);
    catch (IOException ie)
    stop();
    gameLock.lock();
    try
    players[Player1].setSuspended(false);
    otherPlayerConnected.signal();
    finally
    gameLock.unlock();
    Client.java
        public void init()
            startClient();
        public void startClient()
            try
                connection = new Socket(InetAddress.getByName(TienLenHost), 12345);
                input = new Scanner(connection.getInputStream());
                output = new Formatter(connection.getOutputStream());
            catch (IOException ie)
                stop();
            ExecutorService worker = Executors.newFixedThreadPool(1);
            worker.execute(this);
        }So after worker.execute(this), it should go to Server.java and run the function execute() right? But in my case, it doesn't. If you know how to fix this, please let me know. Thanks!

  • Client Server program using Applets for client

    Creating a client server program using Applets for the clients.
    Having problems distrubting the message from client to client
    using ObjectOutputStreams/ObjectInputSteams.
    I can connect each client to simple server and respond with by writting
    the i/o stream of each client but unable to communicate from client to client. If any one out there has in tips of creating a class of objectOutputStreams that holds a array of ObjectOutputStreams and then broadcasts the message to every client, it would be much appreciated
    Thanks.

    Cheers poop for your reply
    I never explained the problem properly. What it is I am trying to set up a Client Server program using Applets as the clients GUI. The problem is broadcasting the message to multiply client connnection(s).
    Below is code, each client can connect and send message to the server. The problems is broadcasting the message to every client connection. The every client can input a message but only the last connected client can receive the message?????? Thanks in advance..
    /*this my server class */
    import java.io.*;
    import java.net.*;
    public class Server extends JFrame
    private static final int ServerPort=8080;
    private static final int MaxClients=10;
    private ObjectOutputStream output=null;
    private ObjectInputStream input=null;
    private BroadCastMessage broadcastMessage;
    public void runServer()          
    BroadCastMessage broadcastMessage= new BroadCastMessage();
    try
    {  //connect to server
    ServerSocket s = new ServerSocket(ServerPort,MaxClients);
         //listen to port 5000 for new connections
         ///max is 25
         System.out.println("Server listening on port "+ServerPort);
    while (state.isProgramRunning())
         try
         /// sGUI.waitForConnection();//new line
         s.setSoTimeout(100);
         //enable times in server-socket
         while (true)     
         Socket incoming = s.accept();
         //wait and accept connnections from serverSocket
         //instance of the class,pases the new connection and message
         //spawn as a thread
         SocketConnection connection=new SocketConnection(incoming,broadcastMessage);
         Thread a = new Thread(connection); a.start();
         System.out.println(state.getConnectionCount()+"Connection received from :"+incoming.getInetAddress());
         catch(InterruptedIOException x){}
    while (state.getConnectionCount()>0);
    System.exit(0);
    }catch (IOException e){}
    public static void main(String[] args)
    Server s =new Server();
         s.runServer();
    /*this is my socket connection thread*/
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    public class SocketConnection implements Runnable
    private ObjectOutputStream out;
    private ObjectOutputStream output=null;
    private ObjectInputStream input=null;
    private BroadCastMessage passOnMessage;
    private Socket theConnection=null;
    private String Inmessage="";
    private int Ocount;
    public SocketConnection(Socket caller,BroadCastMessage broadcastMessage,Ocount)
    theConnection =caller;///(5000,n)
    Ocount=ncount;
    passOnMessage=broadcastMessage;
    public void run()
    try
    getStreams();
    processConnection();
    catch(Exception e)
    {String clientDetails=("connection from IP Address: "+theConnection.getInetAddress());}
    private synchronized void getStreams() throws IOException
    { //get streams to send and receive data
    //set up output buffer to send header information
    ///Ocount++;
    //create new objectoutputstream
    output=passOnMessage.getOutputObject(output,theConnection,Ocount);
    ///flush output buffer to send header info.
    Ocount++;
    //set up input stream for objects
    input =new ObjectInputStream(
    theConnection.getInputStream());
    System.out.print("\nGot I/O streams\n");
    private synchronized void processConnection()throws IOException
    //process connection with client
    String Outmessage =" count : "+status.getConnectionCount();
    //send connection successful message to client
         Outmessage=Outmessage+"SERVER>>>Connection successful";
         output.writeObject(Outmessage);
    output.flush();
    do ///process messages sent from client
         try
         Inmessage = (String) input.readObject();
         System.out.println(Inmessage);
         /* //while the connection is open each line
         that is passed from the client to the server
         is read in and is displayed*/
         messageDetails.setMessage(Inmessage);
         String CurrentMessage=messageDetails.getMessage();
         //output.writeObject(CurrentMessage);
         // output.flush();
         passOnMessage.FloodMessage(CurrentMessage);
         //sending out the message
    catch(ClassNotFoundException classNotFoundException){}
    }while (!Outmessage.equals("CLIENT>>>TERMINATE"));
    /*this my attempt at broadcasting the message to all clients
    my thinking was that you could create a array of objectoutputstreams
    which in turn could be broadcasted(bit confussed here)*/
    import java.io.*;
    import java.net.*;
    public class BroadCastMessage /// implements Runnable
    private int count;
    private String Inmessage="";
    private ObjectOutputStream temp=null;
    private ObjectOutputStream[] output = new ObjectOutputStream [12];
    //temp level of array of objects
    public BroadCastMessage()
    count=0;
    public synchronized void FloodMessage(String message) throws IOException
    System.out.print(count);
         for(int i=0;i<count+1;i++)
         try
    {  System.out.print(count);
         output[count].writeObject(message);
         output[count].flush();
         catch(IOException ioException)
    {ioException.printStackTrace();}
         notifyAll();
    public ObjectOutputStream getOutputObject(ObjectOutputStream out,Socket caller,int Ocount)
    try
    { temp = new ObjectOutputStream(caller.getOutputStream());
         AddObjectOutputStream(temp,Ocount);
    ////FloodMessage();
         catch(IOException ioException)
    {ioException.printStackTrace();}
    return temp;     
    public void AddObjectOutputStream(ObjectOutputStream out,int Ocount)
    { ///add new object to array
    count=Ocount;
    output[count]=out;
    System.out.print("\nthe number of output streams : "+count+"\n");
    }

  • Calling Web Form from Client-Server Form

    Hi. I have an existing Client-Server Form (6i) still in production that needs to call a Web Form and pass it a parameter. Obviously I can't use Call Form or New Form from the client-server version, but can I somehow issue a command line (including a parameter) that opens the Web Form? Any suggestions for accomplishing this?
    I can create a command line like this, but have no idea how to pass a parameter to my Web Form. The Web Form named participants which has a Parameter defined named 'p_participant'.
    *"C:\Program Files\Internet Explorer\iexplore.exe" http://9.35.32.206:7777/forms/frmservlet?form=participants*
    I can also create a command line to open a web form like this to:
    *"C:\Program Files\Internet Explorer\iexplore.exe" http://9.35.32.205:7777/forms/html/sas2.htm*
    Where the sas2.htm looks like this:
    *<html>*
    *<body onload="document.menulaunch.submit();">*
    Launching File Generation...
    If the application does not load in 30 seconds then click the button below:
    *<form name=menulaunch action=http://9.35.32.205:7777/forms/frmservlet?config=FileGeneration method=post>*
    *<script>*
    var wshshell=new ActiveXObject("wscript.shell");
    var username=wshshell.ExpandEnvironmentStrings("%orauser%");
    var pw=wshshell.ExpandEnvironmentStrings("%orapass%");
    document.write("<input type=hidden name=userid value="+username+"/"+pw+"@sparc20*>")*
    *</script>*
    *<input type=submit value=Launch>*
    *</form>*
    *</body>*
    *</html>*
    Any help would be greatly appreciated.
    Edited by: Buechler on Apr 8, 2009 8:58 AM

    Simply add to your URL as follows:
    http://9.35.32.206:7777/forms/frmservlet?form=participants&otherparams=p_participant=<SOME VALUE>I assume you plan to use HOST to make this call. I would recommend something like this:
    HOST ('cmd /c start iexplore.exe "http://9.35.32.206:7777/forms/frmservlet?form=participants&otherparams=p_participant=<SOME VALUE>"');

  • Run a report in reports server calling it from a client/server form

    How can I run a report in reports server calling it from a client/server form ?
    Thanks

    In client server mode you can use RUN_PRODUCT built-in. Lookup help for this built-in for more details.
    Best of luck!

  • Cisco Smart Call Connector / Advanced Client / Server for UC500

    Would like to hear from Cisco:
    Is there still development in progress on Cisco Smart Call Connector, the advanced client, server and operator involving compatibility and support for Windows 8 / Outlook 2013 / and IE 10 32 and 64 bit ?
    Please vote this up if interested !

    jeliasoncisco wrote:Hello. I have a growing practice selling UC500 and would like to know this too. Cisco, please keep selling and developing this. Thanks a million!
    Check forums here or talk to your Channel Account Manager.
    Cisco doesn't care for the UC500 anymore and will not continue selling it for much longer.

  • How to call Oracle Report 6i from a java swing/ejb codes (client server)

    Hi to all.
    We now have to do reports using Oracle Reports that have to call from Java Swing (interface) / EJB (Backend).
    How can we call the Oracle Reports 6i from Java Swing?
    Do anybody done that?...Any ideas? Where should we find the resourse, if any?
    Thanks in advance and best wishes to all,
    Rushdan.

    Hi,
    6i
    1) One way
    Runtime.getRuntime().exec("rwcli60 report=test.rdf .... server=server_name ...<cmd line params>...");
    2) From swing, open a browser and submit request programmatically
    Re: Calling reports6i reports from java swing client serve application
    Thanks
    Ratheesh

  • Client/server

    Hi, i am doing a client/server arc .I have a server , that will connected to the oracle , using jdbc.The client here is an application, how do i change it to applet?
    The server code
    import java.sql.*;
    import java.util.Properties;
    import java.io.*;
    import java.net.*;
    public class CommentsServer extends Thread {
    public static final int DEFAULT_PORT = 7777;
    protected int port;
    protected ServerSocket server;
    String username ="combtest";
    String password = "combtest";
    public static void main (String args[]) {
    int port=0;
    if (args.length == 1) {
    try {
    port = Integer.parseInt (args[0]);
    } catch (NumberFormatException e) { }
    try {
         Class.forName("oracle.jdbc.driver.OracleDriver");
    String sourceURL ="jdbc:oracle:thin:@klm:1521:KLMPMIS";
    String user="combtest";
    String password="combtest";
    catch (Exception e) {
    System.err.println("Failed to load JDBC driver.");
    System.exit (1);
    new CommentsServer (port);
    public CommentsServer (int port) {
    super ("Comments Server");
    if (port == 0)
    port = DEFAULT_PORT;
    this.port = port;
    try {
    server = new ServerSocket (port);
    } catch (IOException e) {
    System.err.println ("Error creating server");
    System.exit (1);
    start();
    public void run() {
    System.out.println ("Server Running");
    ThreadGroup connections = new ThreadGroup ("Comment Connections");
    connections.setMaxPriority(this.getPriority()-1);
    try {
    while (true) {
    Socket client = server.accept();
    System.out.println ("Connection from: " + client.getInetAddress().getHostName());
    CommentsConnection c = new CommentsConnection (connections, client);
    } catch (IOException e) {
    System.err.println ("Exception listening");
    System.exit (1);
    System.exit (0);
    class CommentsConnection extends Thread {
    static int counter = 0;
    protected ObjectInputStream in;
    protected PrintWriter out;
    public CommentsConnection (ThreadGroup group, Socket client) {
    super (group, "Connection " + counter++);
    try {
    in = new ObjectInputStream (client.getInputStream ());
    out = new PrintWriter (client.getOutputStream(), true);
    } catch (IOException e) {
    try {
    client.close();
    } catch (IOException e2) { }
    System.err.println ("Unable to connect.");
    return;
    start();
    public void run () {
    try {
    String mode = (String)in.readObject();
    if (mode.equals("insert")) {
         String name=(String)in.readObject();
    try {
         String u="jdbc:oracle:thin:@klm:1521:KLMPMIS";
         Connection con=DriverManager.getConnection(u,"combtest","combtest");
         PreparedStatement prep=con.prepareStatement("Insert into TEST values(?)");
         prep.setString(1,name);
         if(prep.executeUpdate()!=1)
         throw new Exception("Bad update");
    } catch (Exception e) {
    out.println ("Error updating: " + e);
    return;
    } else if (mode.equals("query")) {
    try {
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@klmsph1:1521:KLMPMIS","combtest","combtest");
    Statement statement=con.createStatement();
    ResultSet result=statement.executeQuery("SELECT * FROM TEST");
    out.println("Name");
    int nameCol=result.findColumn("NAME");
    String name,user,comments;
    while(result.next())
         name=result.getString(nameCol);
         out.println(name);
    statement.close();
    con.close();
    } catch (Exception e) {
    out.println ("Error querying: " + e);
    return;
    } else {
    out.println ("Invalid Command: " + mode);
    } catch (Exception e) {
    out.println ("Error reading Stream: " + e);
    out.close();
    the client code
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class CommentsClient extends JApplet{
    TextArea ta;
    TextField name;     
    public static final int DEFAULT_PORT = 7777;
    private static final String QueryString = "query";
    private static final String InsertString = "insert";
    private int port = 0;
    private String host = null;
    private OutputStream os = null;
    public CommentsClient (String host, int port, OutputStream os) {
    this.host = host;
    this.port = ((port == 0) ? DEFAULT_PORT : port);
    this.os = os;
    query();
    public CommentsClient (String host, int port, OutputStream os,
    String name) {
    this.host = host;
    this.port = ((port == 0) ? DEFAULT_PORT : port);
    this.os = os;
    insert(name);
    private void query () {
    PrintWriter out = new PrintWriter (os, true);
    try {
    Socket s = new Socket (host, port);
    ObjectOutputStream oos = new ObjectOutputStream (s.getOutputStream());
    // PrintWriter out=new PrintWriter(s.getOutputStream(),true);
    oos.writeObject (QueryString);
    oos.flush();
    BufferedReader in = new BufferedReader (new InputStreamReader (s.getInputStream()));
    String line;
    while ((line = in.readLine()) != null) {
    out.println (line);
    out.close();
    s.close();
    } catch (IOException e) {
    out.println ("Error querying." + e);
    return;
    private void insert (String name) {
    PrintWriter out = new PrintWriter (os, true);
    try {
    Socket s = new Socket (host, port);
    ObjectOutputStream oos = new ObjectOutputStream (s.getOutputStream());
    oos.writeObject (InsertString);
    oos.writeObject (name);
    oos.flush();
    BufferedReader in = new BufferedReader (new InputStreamReader (s.getInputStream()));
    String line;
    while ((line = in.readLine()) != null) {
    out.println (line);
    oos.close();
    s.close();
    } catch (IOException e) {
    out.println ("Error inserting." + e);
    return;
    public static void main (String args[]) {
    if (args.length == 0) {
    CommentsClient cc = new CommentsClient ("localhost", 0, System.out);
    } else if (args.length == 1) {
    CommentsClient cc = new CommentsClient ("localhost", 0, System.out, args[0]);
    the applet (acts as an interface)
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    import java.io.*;
    //<applet code = "CommentsApplet" width = 800 height = 600>
    //</applet>
    public class CommentsApplet extends Applet {
    TextArea ta;
    TextField name;
    TextField user;
    TextField comments;
    public void init () {
    Panel p1 = new Panel(new BorderLayout(10, 10));
    Button b1 = new Button ("Query");
    p1.add (b1, BorderLayout.SOUTH);
    ta = new TextArea ();
    ta.setEditable(false);
    p1.add (ta, BorderLayout.CENTER);
    b1.addActionListener (new ActionListener() {
    public void actionPerformed (ActionEvent e) {
    ByteArrayOutputStream bao = new ByteArrayOutputStream();
    CommentsClient cc = new CommentsClient ("localhost", 0, bao);
    ta.setText (bao.toString());
    add (p1);
    Panel p2 = new Panel (new BorderLayout (10, 10));
    Button b2 = new Button ("Insert");
    p2.add (b2, BorderLayout.SOUTH);
    Panel p3 = new Panel();
    name = new TextField ("", 10);
    p3.add (name);
    p2.add (p3, BorderLayout.CENTER);
    b2.addActionListener (new ActionListener() {
    public void actionPerformed (ActionEvent e) {
    ByteArrayOutputStream bao = new ByteArrayOutputStream();
    CommentsClient cc = new CommentsClient ("localhost", 0, bao, name.getText());
    ta.setText (bao.toString());
    add (p2);
    the html file
    <html>
    <body>
    <hr>
    <applet
    code=CommentsApplet.class
    width = 400
    height = 400
    >
    </applet>
    <hr>
    </body>
    </html>
    Thanks in advance,
    Jessy

    hi
    I have no idea what you are doing. Strange programming
    public class CommentsClient extends JApplet why does it extends JApplet when it isn't a JApplet but an application
    and why is there a second applet
    public class CommentsApplet extends Applet (should this be extends JPanel??)
    but for normal classes this is the procedure
    rename the constructor in "public void init()" the method init is automaticly called by the browser.
    remove the main method if there is some code in the main method that needed move it to the init method. ( in your case the arguments can't be read from the command line but must be read out of the *.html file )

  • An rmi client server design problem

    I am implementng a networked cards game in java using rmi . The server keeps track of the turn of the players and activates ther clients(on an applet) whose turn it is to play .
    Both client and server call each others methods.
    Prblem one :
    Right now if a a client disconnects , a process run through all the clients active and gets a remote exception on the server and removes ALL the 4 players i nthat particulat group. If I want to save the state and allow any player to contuniue from there , how will I do it?
    Problem 2:
    How do I keep track of the time a client takes to play.
    If he takes longer than say 5 mintes , I should disconnect him.

    There seem to be two issues at stake: <b>catching the remote exception</b> and <b>multithreading</b> your application on the server.
    When a client disconnects "suddenly" (without logging off via remote method call to alert server), the remote method call by the server to all <i>n</i> players triggers a remote exception that must be caught and dealt with accordingly (do I understand that it is causing the application to exit at present?) When caught, you must identify which player is "gone" and remove that client from the pool of client objects.
    Right now, it sounds as if the app is NOT multithreaded. You can create a low-priority thread that looks at a time variable for each player to determine its last moment of play. This means every successful remote call from client-server or vice-versa will update that client's 'lastplayed' variable with (long) System.currentTimeMillis() for example.

  • TCP server applet, can't instance ServerSocket

    Hy guys ! i'm havin trouble getting my server applet on it's feet, this is mainly because it won't get past instancing the server socket.
    this is the code i'm using, i've put it in a button's event handler
            String clientSentence;
            try{
            System.out.println("starting Server");
            ServerSocket welcomeSocket = new ServerSocket(6789);
            while (true) {
                Socket connectionSocket = welcomeSocket.accept();
                System.out.println("Server has started");
                BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
                DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream());
                clientSentence = inFromClient.readLine();
            }catch(Exception e){
            System.out.println("there's a problem :"+e.getMessage());}i run the applet, click the button, i see "starting Server", and it locks up. I've tried other ports, no difference it locks up on any port

    OK, let's forget the applet now. Your application should work. "Does not get that far". How far does it get?
    A debugger should tell you. Or some System.out.println() placed all over the place. It's hard to see what happens with so little info. I strongly believe that it gets farther than this. It gets to the accept() call and it blocks there, as it should. Let it run to wherever it goes, open a Command Prompt and type "netstat -an". I believe your server should be listed something like this:
    TCP    0.0.0.0:6789            0.0.0.0:0              LISTENINGIf it is, the application works fine.
    Check the code with correct System.out.println():
    package testcuc;
    import java.io.*;
    import java.net.*;
    public class Main {
        public static void main(String[] args) {
            String clientSentence;
            String capitalizedSentence;
            try{
            System.out.println("starting Server");
            ServerSocket welcomeSocket = new ServerSocket(6789);
            System.out.println("Server has started");
            while (true) {
                System.out.println("Waiting for client to connect");
                Socket connectionSocket = welcomeSocket.accept();
                System.out.println("Client connected");
                BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
                DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream());
                clientSentence = inFromClient.readLine();
                capitalizedSentence =clientSentence.toUpperCase() + '\n';
                outToClient.writeBytes(capitalizedSentence);
            }catch(Exception e){
            e.printStackTrace();}
        }//main
    }//MainEdited by: baftos on May 18, 2009 2:47 PM

  • Forms Client Java Applet waiting several minutes

    Hello,
    We use Forms 10.1.2.0 and html/javascript/plsql applications.
    All forms applications are working but
    we have the problem that from time to time the client java applet must wait minutes until there is an answer from the forms-servlet (especially when there is high activity in the system).
    More than one user is working in the form with high activity - the applet sends a request
    over the network - after 4 minutes the result is shown and you can go on working
    without problems.
    So a lot of users think the application has crashed and terminate before.
    The applet shows no error messages.
    There is no sign that there is a lost connection between applet and servlet.
    It is not reproducible. That means you can work 2 hours and everything is ok
    or you work 5 minutes and you have to wait.
    network problems?
    firewall problems?
    do requests of the forms servlet to the database have minor priority on the application server
    than html/plsql requests?
    any ideas?

    when the problem occurs (user has to wait 3-4 minutes) we found in the log
    3 heartbeats from the forms client within 2 seconds ?
    after 3-4 minutes the forms client is ok (user can go on working)
    and the pings are every 2 minutes (like it is expected).
    The application.log file may contain duplicate posts requests with
    identical pragma header numbers, indicating that the client
    is resending
    requests due to network packet losses. Under normal circumstances,
    only the last Post request, terminating a Forms session,
    should contain
    a duplicate pragma header number.
    ...a network problem ?
    anyone else who had the same problem ?

Maybe you are looking for