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 6 years ago.
Improve this question
I'm attempting to create a web page that takes user inputs from form fields and outputs various calculations as values displayed on the same web page. In addition to this, the user inputs create a "Gun" class instance and set its fields. Another class's method within the project generates random x and y coordinates based specific fields from the Gun instance. These coordinates are meant to be used in a Swing class, perhaps fillOval, to draw circles (which represent bullets) over an image embedded in the page. This is essentially a shot simulator.
Can this be done? Can a JFrame be embeded in a web page? Or am I wasting my time? Is there a more efficient language for this than Java?
Can a JFrame be embeded in a web page?
No, at least not directly, but an Applet can be embedded. Since you ask specifically about Swing, you can use a JApplet, which is an Applet that serves as a top-level Swing container, analogous to a JFrame.
As #ElliottFrisch warned, however, applets are a somewhat dated technology. The biggest problem with them from my perspective is that many browsers do not support them -- either because no JRE is installed on the client machine, or because Java support is not enabled in the browser. The latter is quite common these days, even on machines with a JRE, partially as a result of a series of unfortunate Java vulnerabilities.
Can a JFrame be embeded in a web page?
The short answer is yes, with an Applet. However, applets are an older technology and I would suggest you look into more modern web based approaches.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am trying to show a Bokeh plot in Firefox. There are quite many sub-graphs (approximately 200), each showing 1-4 objects.
I am receiving in Firefox:
"A webpage is slowing down your browser."
Some notes:
After rebooting, it works fine for a couple of times.
I am behind a corporate proxy. I ask myself if it may be the cause. Some JavaScript and CSS is being loaded from cnb.pydata.com.
It sounds like your Firefox version is having issues with said webpage. Although I'd say that the design of such site trying to show 200 JS driven plots seems questionable.
As far as I know, there is little that you can do besides updating Firefox, they have been busy lately improving many elements of performance, or trying another browser with better JS performance like Chrome.
If you're in a corporate network it might be many not possible for you to upgrade or install, then you have to go to you IT department looking for help.
Now, since you're generating the HTML with the graphs, perhaps would it be a better idea for you to make a "dashboard" where you show a few and then use dropdown menus or sliders to control which plots are shown at any given time. I've seen solutions using using bokeh itself to do so, or if you want eventually somethign fancier you can also use flask.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Being comfortable with Javascript, HTML5, and CSS3, allows me to achieve most anything I want to accomplish in a given design, however removing Javascript from the equation leaves little to offer in terms of dynamic content. Being that some users prefer to disable JavaScript, albeit this is exception rather than the norm, in such use cases, are there any alternative technologies that would (could) not be disabled, and thus allow for workaround-dynamic content to still be present in the absence of Javascript?
In order to satisfy these requirements the following criteria would have to be met:
(1) The technology has cross-browser compatibility with (nearly) all modern browsers.
(2) The technology would need to allow for user input on the website (such as text fields), which would then be sent sever-side for processing, then return data (such as a chunk of HTML).
(3) Then, this technology would also need to be able to take this chunk of HTML/data and add it to the page without a refresh (ideally, though a refresh my be able to be tolerated if necessary).
Doing my own due diligence, I have come up with part of an answer, though I am not sure about the feasibility of my approach, and thus would like to hear what you think about using server-sided scripting (like PHP) and HTTP-META-REFRESH, to achieve such a result.
Does such an approach sound feasible, or is PHP-scripting on the server side also have the ability to (going out on a limb here) be turned off by the user as well? If it can be turned off, furthermore, are there any other ways to send and receive data that can't be (or has a much less likelihood of being) turned off, then use this data to change the HTML of a given page similar to the way the "document.getElementById(id).innerHTML = new HTML" approach?
Server-side languages like PHP cannot be "turned off" by the user.
Using "http-meta-refresh" is not relevant. You cannot use that to simulate in any way the interactivity of JavaScript. It might meet point 1 (browser availability) but it has nothing to do with points 2 and 3.
Specifically, it cannot be used to issue POST requests (point 2) and doing a meta refresh refreshes the page. It misses point 3 entirely.
There is no way of achieving JavaScript-like functionality such that it cannot be turned off and works in all browsers. There is nothing remotely like this.
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 create a website front page which behaves more like an actual desktop application with windows and ability to drag and drop assets from one window to the next (and untop of other items on another windows).
This is very easily done in a desktop application. How can we replicate it using on a website?
I know I can do jquery such as this: http:// jsfiddle.net/4Vfm5/1095/
to resize and move an image.
What I want to do is make the website behave more like an application with windows. I am not as concerned about mobile applications as website viewed via desktop computer.
Are there any frameworks that help the process?
I have seen some site that behave that way (using "Div"s for each window) - but I gather they used a lot of custom code to make it look like that. I am trying to see if there are packages that help the process along?
This is how I want the webpage to look like
https://drive.google.com/file/d/0B_FN5UlpyrboVU9WZzFRdGl6TlE/view?usp=sharing
Thank you so much.
Jack
One you can try is Ext JS:
http://www.sencha.com/products/extjs
Depending on your use case you may need to pay them (I think if you use it for a commercial purpose). But it supports Layout and Controls similar to the type of design you would expect from a desktop UI framework. It also has drag and drop support built in.
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 8 years ago.
Improve this question
Hi I have developed a site,but now i required to add a language translator in my site. how to add a language translator to translate all content of my site to a desired language dynamically.help me to solve this
You should not use any translators that do this operation on fly. Remember that translators are your enemy when translating more than one word. Especially when both languages are not english. Secondly this could take many processing resources and without caching it, it will blow up your network.
To do it right, you should apply i18n feature to your site. This will require from you:
replace any labels on your site with i18n tags with i18n keys
create i18n property fields holding translations for each i18 key
change of language will require page reload
when displaying content (taken from database or the source), you should create content per language, and select it basing on Locale from Request
As you can see, creating fully multi-language app is not a walk in the park, it is hard work.
If you want to provide your website content in different languages, you will need a localisation service (depending on the size/scale of your site) or use an API such as Google Translate's API, which is not free. See Beri's answer on performance implications.
You need to do a bit of research yourself and see which solution suits your needs. We don't have much context on your site, so it's a bit difficult to answer.
This answer may be relevant to you.
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 3 years ago.
Improve this question
I am building a rails application that lets users upload and listen to songs. It would be nice to build a player for these files that is capable of the following:
Requirements
It shows sound waves (static) based on the song's melody
It has a play/pause button
The progress bar is draggable to fast forward and rewind
It fires events in the background asynchronously for tracking purposes, like play count, listener's geo data, listener retention (average user attention span) - all this functionality will be in the back end, it just needs to be triggered
It needs to be embedded on other websites
All in all, it is pretty much like the soundcloud player with some extra features.
Questions
Which technology would you use for this? Flash? Javascript? Something else?
Is there a ruby gem for this?
Are there (customizable) tools out there already that more or less meet these requirements?
Which technology would you use for this? Flash? Javascript? Something else?
For compatibility purposes, you'd really need to use both. Not all devices support Flash, and not all browsers support the Javascript features needed for audio output.
Is there a ruby gem for this?
No. Most of the functionality you're describing would exist on the client side, not on the server.
Are there (customizable) tools out there already that more or less meet these requirements?
Many of them, yes. See jPlayer, for instance.