• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

85 line program...wondering if it's possible to do in Applets

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never created an applet before. I do know Java and HTML though. I have a server, which is currently running as an application. Is there a way to port this to an Applet? If the server was online (I have a website that I could put it on), I wouldn't have to have it running on my computer. The client is running and will run as an application. Here is my server code:
NOTE: Places that are security codes and otherwise things you shouldn't know will be replaced with ******'s...Don't worry about that, just the application.

Do I have to make any major changes? Do I just have to extend Applet?
Thanks,
John Price aka cc11rocks
 
Paul Clapham
Sheriff
Pie
Posts: 20168
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see a GUI, so I can't understand what would be the point of making it an applet. It is possible to have applets which don't display anything in their GUI, but why would you want a chat server to run as an applet?

Also you would have to sign your applet to allow it to act as a socket server.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just need a server to be online, and not on my computer. Would a user have to be on my website for the server to work? If so, this is not what I want. I just got my first applet up and running on my website, so I guess I know how to use it know.
Check my knowledge please:
Applet starts code from init() method.

Question:
From the init method, you can add other methods to run?

Example of my Question (no I'm not writing code, just making sure I know how applets work):

If someone typed any character, the jtextfield would display the string "Hello World" in their, correct? I just want to make sure everything is the same.

General questions:
How do you use/create and what are signed applets?
What are the major differences between Applets and Applications, coding-wise? (I know there is no JFrame, JPanel, etc.)

Thanks,
cc11rocks aka John Price

EDIT FOR CLARIFICATION(To the people who may think I'm stupid and/or don't know how to code):
Yes, I know the code uphead won't compile. I am using a general overview to ask my question and give an example. I know you have to implement keylistener and use all the methods and stuff. I realize the jtextfield isn't initialized. This is a general type code, mostly asking about syntax and not about the code itself, since Java Applications and Applets (to my knowlege), have the same code (and especially for JTextFields).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic