Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
recently I have been making easy games such as 'blackjack' , quizzes, etc. How do I host these games online so others can play? Keep in mind these games do not use an application. Thank you
If your application is Swing/AWT based - and if you implement the game as a Component or JComponent - you can then, with minimal changes, make it run as both a Swing/AWT (i.e. desktop) application or as an Applet (embedded in a web page). You can make both run from the same .jar file, if you set it up right, and that file can also contain you resources (images, sounds). (It doesn't have too - but they you may need to load these resource in a somewhat different way, depending whether you are running as an application or applet.)
For the desktop, place you game component into a JFrame and display this (with appropriate sizing, etc).
For the web, place the component into an Applet. You will need a bunch of configuration and an HTML page with the applet in it. But once you have this you can host you game on any ordinary ISP site.
This may be a bit out of date, but: http://docs.oracle.com/javase/tutorial/deployment/applet/
I would suggest looking into Ruby on Rails for back end develoment: http://rubyonrails.org/
and Javascript for front end development: http://www.w3schools.com/js/
http://www.codecademy.com/ also has great lesson plans for building online games.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to write various web browser games and apps to post to my own personal website, mostly for fun. I'm pretty familiar with Java and starting to get into C a little. As I understand it, I cant just run a common java application from a web browser but have to use the JApplet class or Applet class(or possibly others.) Can I use a JApplet to make fairly sophisticated games or is it really just for basic display images? I'm willing to learn something completely outside of Java.
I've been browsing the web but am a little overwhelmed in deciding how I should go about this. I would like to make games that are pretty simple graphically, but can remember things like a characters inventory.
Its really just a place to host different games and things I make. How should I go about this?
I hope this isn't too vague.
The only language you can guarantee within a web browser is JavaScript. You can write highly sophisticated games using JavaScript, so this shouldn't be a major problem - you can see an example written using Unreal Engine and JavaScript on YouTube.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Hi I want to create a small web application which will take inputs such as 80 and 120 and return the GCD of those numbers. I want to write the logic in Java. When the user enters 80 and 120 and clicks on calculate button, the values must be passed to the algorithm and return the answer to be displayed on the application again. How do I link the java algorithm to the html page in order to achieve this? Kindly suggest. Is there no other way of doing this other than creating a Java applet for this and deploying it on the application? Kindly help.
Use "Applets" if you want the Java code to run in the users browser and not on a remote server.
Applets are, however, a waning technology due to the numerous attacks that has gone through the JVM to avoid the security checks in the browser, so your users will most likely not see the experience you want them to. Additionally I believe that the ability for the Java program to interact with its surrounding page has been crippled again for security reasons.
Your best bet is to use Java for server side code only (which it is quite fine for - Google Application Engine is perhaps the easiest way to get started) and to use JavaScript for client side code.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm working on a cricket scoring web-based project where I need to display the scorecard page in a separate Large LED TV Monitor where the scorer has a different page to score in the browser, how I'm gonna achieve this? Any suggestions?
Technologies I'm using : Java, JSP, Servlets, HTML, CSS, JQuery, Javascript
First, you need a PC with a graphics card with two outputs, so you can attach two monitors.
The next step depends on your OS. Configure it to display one big desktop on both screens. now, you just need to open a new browser window with coordinates that are on the second big LED TV.
A number of large screen LED TVs have build in web browsing capabilities. You could possibly make use of one of those to output the result.
Alternatively you would need a separate device to drive the TV. In which case I would suggest an android tablet. Very easy to set up and a number of them (nexus) come with hdmi output.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have made games in jar format using processing.org, Netbeans and Eclipse! These are desktop based games I want to run these games on online servers (web) without altering the code. This game also have embedded sounds and graphics in its folder. Please help me out I am new to web app development?
You can't just take a desktop application and put it somewhere and make it work in a webbrowser and multiuser magically.
You need to change code if you want your desktop application to become a webapplication.
It's a completely different development process.
For deploying Java desktop apps., the best option is usually to install the app. direct from a link using Java Web Start. JWS works on Windows, OS X & *nix.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am looking for a program to show a slotmachine animation (preferablly written in Java/SVG). I'm interested in showing the rotating wheels with images of my own choice.
I have found
http://www.doit.org/java/slot/SlotMachine.java
which is the source code for an Applet.
http://www.cs.columbia.edu/~sh553/teaching/w3134-s07/review/SlotMachine.java
Basic Slot Machine
do not have graphic support.
I am hoping there might be better/other solutions I could use for showing on a webpage.
http://www.treebuilder.de/default.asp?file=163540.xml
shows an SVG solution - this might be the closest to what I am looking for so far.
so far i could test the above applet by making a standalone java app from it. It works for the graphic part - the audio issue is discussed in
how can i run an applet as an application?:
I will now at least be able to try out other graphics without needing the applet params to be defined in a web page. I'd rather have a standalone solution e.g. like a restful Java app.
See Wheel, part of a larger project by Jernej Vicic, and this later variation, incorporated into a project by Mark Boyns.
It looks like you have examples of a slot machine model. For the view, you might look at this answer that suggests using Unicode glyphs or implementing the Icon interface. Also, consider this MVC example and this answer that illustrates rendering a BufferedImage.
Animating the visible face is straightforward, but a pseudo-perspective for adjacent facets would require a trapezoidal transform, available in JAI.
Addendum: How can I run an applet as an application?
Several examples of the hybrid approach are cited here. Note that applets, too, must be constructed and manipulated on the event dispatch thread. Also consider Java Web Start for deployment.