What is the equivalent of a Java applet in .NET? Is it Silverlight? Is Java applet still widely in use?
Java applets were "the new hot thing" in 1997, when Java 1.0 came out. After a few years, they became less and less popular, mainly because installing Java on a computer was a big hurdle for many people (you had to download the whole JRE, which was big, it took a long time to install and Java was not that fast at that time - so many people saw it as a slow, bloated thing).
Macromedia Flash (which became Adobe Flash later, ofcourse) had advantages over Java applets in this regard - the plug-in was quick and easy to install, and so it became the dominant thing for interactive multimedia stuff on the web.
Microsoft's Silverlight is meant to be a competitor for Flash and Sun's JavaFX.
JavaFX is Sun's technology that should make it easy to do Flash-like things on the Java virtual machine. If JavaFX becomes a success, then Java applets using JavaFX might become popular again.
Note that earlier this year, Sun released a completely rewritten Java browser plug-in which is quicker and easier to install than the old plug-in. On of the things Sun is working on is making it just as easy to install the Java plug-in as it is to install the Flash plug-in.
Silverlight is analagous to Java applets, but not really equivalent. In my experience, Java applets are being used less and less.
Java applets are seriously out of vogue now - I haven't heard of any new apps using them in years. .NET has silverlight, which is more of a response to Flash than to Java applets.
In this day and age with JQuery and Mootools, MVC architecture, and Chrome's V8 engine, it might actually be better to just write your application in Javascript.
Silverlight.
However, while Silverlight may be the new hotness, Java applets are still a lot more popular... most people have a JVM, but most do not appreciate a massive Silverlight install just to see your web page.
Now, many things that could only be reasonably done in Java or ActiveX are done in plain old JavaScript using new AJAX/DHTML libraries like JQuery and Ext JS. Example: Google Maps. Unless you're doing fancy graphics, try JavaScript first.
From a language perspective, there is a Java-like language available in .NET called J#, which can ease your pain if you are translating Java code to the .NET platform. It doesn't emulate the Java GUI libraries, etc. but at least emulates the syntax.
Silverlight or XBAP. See the FAQ for differences.
Basically XBAP applications work on Windows only and run on the full .NET Framework. Silverlight on the other hand uses different core and set of libraries and is designed to be cross-platform.
Either SilverLight, or an ActiveX control (still in use on some sites). Java applet will work only if a JVM is installed on the client machine.
You'll see applets in use more in enterprises where tight control is maintained over installed Java versions and the browsers i.e. where the execution environment is constrained.
However I'm seeing fewer and fewer applet solutions even in these environments, especially with the rise of RIAs.
Related
I have a BlueJ applet that I want to run in a web browser. I've realized that the tutorial I was trying to learn from was outdated, and applets are really obsolete. What I'm trying to figure out (I'm searching but finding a lot more outdated info, hence my confusion) is what replaced applets, and if there is still a viable way to use my .jar file in a web app.
what replaced applets
The browser, as a runtime, has become powerful enough to make Java Applets unnecessary. Modern webapps with some amount of JavaScript on the frontend replaced Java Applets.
and if there is still a viable way to use my .jar file in a web app.
No, there isn't. Java Applets are dead and there is no viable way to run them for the vast majority of users on the public Internet.
If you are a software developer, you should abandon applets and start learning a modern full-stack framework. There are many to choose from.
May I suggest you taking a look at CheerpJ?
It allows for both old java applet to run and for java applications in general to be executed in the browser.
There is an extension for Chromium/Google Chrome that can be used for free to test the applet and our product.
Disclaimer: I work for Leaning Technologies, the company behind the CheerpJ project.
I am using Ubuntu on my computer, and I do not want to switch to another operating system.
I'm looking for a software that would let me program cross platform apps (for smartphones) with one programming language.
I would prefer a .NET language. Yes, I have looked at Mono, but they only offer their software in Windows and Mac.
Is there a software that would let me build a cross platform app? (I don't like Java, but JavaScript is one that I can handle)
MONO is available for more than both Mac and Windows. It runs in Ubuntu and instructions can be obtained from here.
iOS apps can unfortunately not be built without xcode, but the coding can easily be reused between Ubuntu and Mac. One software to checkout is Xamarin which allows you to use c# to develop iPhone and Android apps. I've been coding in .Net for a while, and I have to say that when I had to do a unix class project, MONO and Xamarin saved my life
Note: I know that your question specifically said you don't like the idea of switching platforms like you would need to in MONO, but I've done a lot of research on this and I've determined it to be my best option, I'd think it'll work for you if you're willing to use a Mac or PC
I'm looking for a software that would let me program cross platform apps (for smartphones) with one programming language.
If you are looking for some tools for developing cross platform apps for smartphones, I suggest you PhoneGap
Is there a software that would let me build a cross platform app? (I don't like Java, but JavaScript is one that I can handle)
You are using ubuntu and want to use .Net, No this is not a convenient solution. If you want a platform independent language, I absolutely suggest you, JAVA ;)
Please notice that:
Java IS NOT JavaScript and they are not related to each other.
I had the same question. I did come across Appcelerator. It seems that they supported Linux previously and the single language you can write in is Javascript.
It's not opensource. You have to make an account to download and install it, but there's free versions for solo developers. I'd rather use Kivy to develop in Python though ;)
Good luck.
My company is revamping the IT infrastructure and systems, so we are at the middle of finalizing the technology for developing the new system.
We have come to two candidates; Java & Python.
The main criteria of the choice is the language must be complete; in a sense that it must be able to use for web & desktop applications development. Java is proven is this field, with many good web framework (JSF, Hibernate, etc) and relatively good GUI library (SWT, Swing).
However, Python looks more delicious as from my personal experience, development in Python is efficient, I could do more with less time (I only have experience in web development with Django). However, as for the desktop application, I have yet find any good GUI library that comes integrated with the IDE as Swing.
Can someone points me the best if possible GUI framework for desktop application for Python?
For Python GUI, there are 3 main options:
wxPython
PyQt
PySide
(PySide is a derivation of PyQt).
For building the interface, you can use wxGlade for wx, and the packaged QtDesigner for PyQt/PySide (Which both can convert the .ui files to .py
All 3 use native OS widgets, so will look right at home.
Despite having more experience in wx, I actually prefer PyQt, as I find it's a lot easir to work with.
For an integrated IDE for developing Python GUI apps, there aren't any (afaik) complete apps, however, I personally use PyDev in Eclipse, which can handle opening .ui files in QtDesigner for you, which you'd save, run the tool to make a .py file, and it'll work pretty much flawlessly.
It is entirely possible to build a SWING GUI application with Python. Look for Jython, which is Python for the JVM. Any pure Python (no compiled C code) libraries for Python will work with Jython including most of the Python standard libraries.
Also, because Jython is a JVM language, it has access to objects provided by Java libraries such as SWING, and also can use the JVM threading model. Multithreading in plain Python is difficult due to the Global Interpreter Lock. Jython does not have that limitation.
If other people in the company are leaning towards Java, then Jython with SWING would be a safer choice because when people say that you should have used Java because Cool Library X is available, you just smile and say that Jython can also leverage Cool Library X because Jython is a JVM language.
Question: embed a portable web browser without cache into a java app? Using Java SE.
Can this be done? Are there any JNI supports for e.g. Chrome or Firefox?
Maybe Qt? QtJambi would allow interfacing with the Webbrowser? From what I understand QtJambi is now maintained by the community and LPGL, is QtWebbrowser embeddable for this purpose in the same licence?
Examining the available documentation and over the past few days this is what has emerged:
The open source browsers are Webkit (which is used for e.g. Safari), and the Mozilla flavoured Firefox. There is also Chromium which is the open source version of the Google flavoured Chrome which uses a lesser javascript engine (squirrel as opposed to v8) and does not have the multi-separate-thread modularisation of Google Chrome.
Additional information on Firefox: Mozilla Firefox is based on an application called xulrunner which uses xml and javascript to provide the additional functionality of firefox (other than the 'not so basic' browser - such things as the html parser, css renderer and javascript parser). Xulrunner is the implementation of the browser.
Firefox implements its own private xulrunner, however additionally there is xulrunner as a standalone install.
Xulrunner can be used to create standalone applications, that are based on a web-browser, and has support for javascript. Xulrunner is also used to create the plugins for firefox providing additional functionality.
In order to connect the front end to something a bit more sustained and powerful than javascript (which has improved in leaps and bounds in recent years), but is still not the strongest sustained engine, there is a C-library called xpcom.
Xulrunner uses xpcom (written in C) to expose the javascript variables and parse the dom, and link javascript variables, and do other 'browsery' things like read headers etc. More on Xulrunner and xpcom in a moment.
If you want a browser that is recent and functional (html 4 or 5, good support for css2 at least, and some css3, and solid rendering of javascript), your best bet other than compiling and embedding one of these open source browsers is to use SWT.
SWT is a gui interface, similar to swing, except that it implements a webbrowser type interface, and can be used to implement a browser. SWT also has some developed interfaces to interact both with the dom and the like. SWT was developed by IBM and is actively maintained.
What SWT does is implement the OS system browser, and has support for every major os. On the upside, this means that there is no need to embed your own browser, on the downside you are stuck with whatever browser / parsers exist on the operating systems, at whichever version. The default behaviour on a windows os for SWT is to use Internet Explorer.
It is also possible to implement non-os linked browsers like firefox by installing xulrunner, but this is an additional 20mb (not extensive but something to note), as the more recent versions of firefox are not recognised.
It is a requirement to have javaxpcom support and xulrunner to implement a firefox style browser in SWT. The easiest way to go about getting the last version supported by Firefox (xulrunner 1.9.) for javaxpcom is to download an application called prism. Prism uses xulrunner as its base to create browsers that are standalone to specific urls. There is a known hacked xulrunner 1.9. which has some issues - see wikipedia for information on this, if you aim to download xulrunner 1.9.* compiled already from source.
Xulrunner is developed alongside each and every new edition of the Firefox browser. Until v 1.9.* (firefox 3.* if I am not mistaken), there was additional support for a function called javaxpcom which was an interface written to link the c library Xpcom's functions to java.
Firefox's initial announcement of how easy and simple it was to embed and style your own flavour of xulrunner, and that it was easy to port to many different languages (support for C, initially support for Java, Python amongst others), but obviously there is some overhead to accessing and adding libraries.
Xulrunner is being promoted as a potential software solution to compete in the same playing field as java, but suffers the same limitations of javascript / html applications. Within those parameters it functions.
Since version 2 of xulrunner, support for javaxpcom has withered, as there is no active maintainer of that code. It is open source solution so presumably interest from someone with requisite skills might pick that up. Xulrunner is now recently in version 6 at the time of writing this answer. Xpcom however is still going strong. Presumably there was insufficient interest / activity in the community, amongst other potential issues.
Since javaxpcom has been reported to have broken, and requires someone to maintain an interest in the code; that work would have to come from someone who has a vested understanding of Xulrunners xpcom, or at least a collaboration from someone who has an understanding of changes made in xpcom. Comments from what I have read suggest that documentation on xulrunner may not be a detailed as it could be, nor on javaxpcom, but I am not in a position to evaluate these comments.
I had hoped that the basic core functionality could simply have been maintained, keeping the hard work involved in recent browser improvements in functionality 'embeddable'. Firefox's amendments have resulted in extensions breaking in newer versions, a function of keeping up with the times.
A non-open source solution that embeds a web-browser and the like is called webrenderer.com. It is maintained, but there is a price tag attached, which is not insignificant.
Another possible route to implement a web-browser in a java application is to go the route of a cross platform development platform called Qt. QtJambi is a LPGL licensed (previously commercial) webbrowser that has extensive documentation and support for Java implementation. There is obviously learning curve attached to using any new platform. Reasons for the move from commercial to LPGL? Presumably viability and commercial demand for java supported browsers has .... waned? A function of the times we live in no doubt.
GWT is the java / webbrowser google solution. GWT works by allowing developers to write java solutions, and then ports and converts this solution into a stable javascript that can be obfuscated. However GWT is not suited to developing a desktop type application, in the sense that it requires a 'server' implementation for the backend. In this sense it is most suited or similar to a PHP or ASP style client / server solution.
Whilst it is not impossible to write GWT as a desktop application, presumably you would have to implement Apache Derby, or Jetty or similar as an in-house server to do all the to-ing and fro-ing. Its not neat, elegant or specifically designed for this, but madder solutions have been tried. There have been php style desktop applications.
For a number of political and financially motivated reasons it appears that support for porting / embedding java and open source browsers is not on the up and up, a trend which began with apple's lack of interest in supporting java applications. Mind you, the browsers are open source and presumably with enough time and energy, javaxpcom etc. could be sustained, but who is going to do this for free, I do not know.
Java promised a java browser implementation but this was not released with the Java 7, and requires like most other things, an amount of work. Perhaps in 8? It is unclear even there if it will be ready by then, I can't quite work out if its currently on the roadmap or not, and doesn't appear to be their highest priority include.
SWT requires some additional libraries and installation to work on various platforms.
Some other open source solutions which do at least in part appear to work, but the maintenance, support and current interest in appears mixed to none, include JRex, MozSwing. Rhino is a javascript engine, flying saucer an html4 renderer.
If you are talking about Java SE based application I would highly recommend swt 'Browser' component. I have used it myself within Eclipse RCP based app and it works like a charm (flash, javascript support)
I have started making some small Java games that run in a browser and have found a couple of game portals where I can host then (GameJolt.com, JavaGameTomb.com and Games4j.com). Most of the other portals I find either only allow Flash or offer the games for download.
Apart from those above, what other portals exist that allow hosting applets?
In my experience, it seems that Sun is not supporting Applets as much as it used to, instead preferring Java Web Start. My experience with applets has not been ideal, and others have had problems with it as well, especially in newer versions of Windows. I think that is probably a large part of the reason you are having problems finding applet hosting sites. However, for rich clients, I think Java is an excellent development system.
Just my 2 cents.