I recently played around with the SWT browser widget (which is great). I am wondering if I could write a full desktop application with it (with java services behind - e.g. persistence) and what drawbacks I would have to consider. The advantage would be that people without java knowledge could work on the gui. Of course it depends on the requirements and I know that this is not a very specific question. But mabye someone already tried to build a bigger app this way and is willing to share insights.
Thanks
Marcel
I'm not sure I share your opinion of the SWT browser widget. AFAIK it's merely a shell into the default browser on your machine, merely with a few API access points. I've used it for minor things when I needed to show a web page from within the application. But writing a whole application? That doesn't make sense.
If you want to build a web-based application that runs in the browser against a Java based server framework, there are many AJAXian frameworks to do it. You'd still be doing JavaScript for your client code. And you'd still be dealing with all the complexities of different browsers. I'm not sure why you would want to host it inside an SWT application instead of just directly in the browser window.
Related
Without thinking, I created an entire program in Java and began designing a website to use this applet. All it does is create image in a certain way but there is a bit more code (classifications and default values/images) that I just felt was easiest to do with Java. Now I have a Java app and HTML CSS and JavaScript that I can't seem to do much with.
I have thought of 2 ideas (below) but I don't know what the general alternative is to applets nowadays.
I have a spare PC I may use and just alter my applet to run the back-end of a server-based site instead, but I am hesitant to use my own IP and bandwidth for something like this. Also, this app doesn't even need access to the internet so this just seems like way overkill.
I could just release the .jar, but I plan on expanding the available options. I also told people that this website was coming. I'd like to be able to just update the website.
I don't really plan on writing my program in another language. This took me time to make. If there is no way to work Java into my site, I may just abandon the project altogether.
I am mainly concerned with Chrome for this problem.
Edit: I would like to use GitHub as my host, just in case this helps at all.
You can run anything you want on the server, including java programs. So
you could run the image creation program in the server and present the
resulting image using a standard img tag.
So, I have a fully functioning html/javascript/css web app, not sure if that's the right term, it works fine and dandy in a web browser.
The thing is I now have to move it OUT of a browser, OFFLINE, and to the "desktop", make it a standalone app. I would have to somehow wrap it in java/c++/python something, to make it run like that.
I really like Java since that is the language I know out of that list. I have looked into Rhino & Gecko. I haven't really found anything that is a nice plug and play. Like here is my .html file now run with it. I assume it would have to be in a swing window or something too.
Any hints/help/comments?
(As per request, I reposted my comment as an answer.)
The Atom editor is built using only web technologies, and uses the Electron framework (based on the Chromium browser) to run as a standalone application, with no external browser dependencies.
It looks very easy to set up something similar yourself, and basically just requires you to put your files in a special directory. (Electron uses a lot of space, though, so it may not be practical for distributing applications below ~20 MB.)
If you are really looking for an option where you just point at your current html and are off then you might just want to configure run a local web-server. It changes almost nothing about how you are running your application except where it is being served from.
Im trying to resolve following dilemma. I have to develop whole webpage system(with user friendly content management, it should look like very simple Drupal or Joomla) as a project to school. The webpage should have function of adding and removing articles, editing menus, editing whole webpage layout(header position, menu position etc).
Im in phase of deciding which system would be the best for this purpose. I wrote several applications in GWT. It's very quick to develop something, it works on Tomcat etc. So it could be very good adept for this task. But recently I got an idea of writing whole webpage system in JavaFX 2.0 (webpage would open inside the browser).
What is your opinion about this fact ? Should I use JavaFX or GWT? I'm not sure if whole webpage will be quick enough in JavaFX. If the users that will be visiting this page wont have problems with launching this page etc. I havent found any information about this on the internet.
Thanks for your answers :)
Go for GWT (also consider using Vaadin or SmartGWT). It does not require a Java Virtual Machine to be installed on the client. Also, GWT allows the client to download only small pieces of the application, and not the whole thing.
You cited two Content Management Systems like Drupal and Joomla that are written in PHP, so maybe the best solution for you is a CMS written in java like Alfresco or Magnolia.
do you want to do a web page or an applicatin for one plugin ? GWT of course.
GWT
GWT follows a most innovative approach: you write the entire application in Java. But it’s executed in Javascript. A good portion of your code is cross-compiled to Javascript and uploaded to the client.
Judging from the presentations I’ve seen, this approach works surprisingly good. In former times the GWT compiler used to be slow, but today, they seem to have solved (or at least alleviated) the problem. As far as I can see, GWT is an excellent choice
javafx
JavaFX 2.0 is a pretty new GUI framework. So expect a few glitches. The good news is that it’s likely to improve over the years. And I suppose people will start to write JavaFX component frameworks if JavaFX is going to be popular.
There’s a video showing the domain of JavaFX very clearly.
Container terminal monitoring with 3D JavaFX
Source
We need a tool to test a set of fairly complex Java applications. The applications are mostly independent client programs or applets communicating with a servlet or apache server at a remote site. Specs:
Runnable on Windows XP, Vista and 7
Parameterizable (Can specify in a script the sequence of buttons to click, text to type in JTextFields and browser address bar etc.)
Can quit or bail out or display a nasty message if the expected window or dialog box doesn't appear
Record the output on the Java Console of browser in a .txt file (IE is sufficient for now) when the application opens a browser window.
While running, I should be able to see it running with folded hands while it would run
for a few minutes
We were thinking of writing an AWTRobot based tool that reads a command file and does this - (don't know how to do #3 or #4 yet - will ask you folks some day how to detect a window on the desktop). Would you suggest an open source tool available to do this? We don't need anything fancy to capture video or screenshots. Thank you, - M.S.
For browser based automated testing you can use Selenuim or you can use WebDriver.
The selenium project is hosted here
If you don't need to test the way the pages are actually rendered by the browser, but instead need to work at the HTTP/HTTPS/etc request level then have a look at JMeter. It has parametrization, dataproviders, graphs, and a proxy component for recording http user sessions.
If you do need browser testing, then, as has already been mentioned, Selenium is probably the best freely available tool. For production I would recommend using Selenium Remote Control server which can be driven by scripts written in Java/Python/C#/Perl/PHP.
To see what tools people use in real production environments, and to do your own research on what is available I recommend www.sqaforums.com.
Have a look at Sikuli
The reason I suggest this is it sounds like you need to test both a Java applet and the content of a native browser (launched from Java, but not itself Java) -- so it's not "Java all the way".
I'm not sure what you mean by criteria 4, though. It is worth noting that as Sukuli works by image analysis, it won't be able to copy text to a text file.
This question is an invitation for sales pitch, don't you think. How about Mercury Quicktest professional ( I believe its HP Quick test now). I do not believe this will be cheap either ( and well its HP, it will probably only work in IE ;)).
Since you want an open source solution, I believe, the most popular option is selenium and yes its a pain to configure sometimes ( like for Flex for example). So you should try Watir.
There is a lot of good buzz around it and when I evaluated it, I loved what I see.Also it does not work for desktop applications, I suggest you try some other solution for that.
(The problem is open source GUI testing tools are not usually all inclusive. If you need one solution to handle all your gui testing needs, then you should check out the more commercial ones like QTP.
I have used IBM Rational Functional Tester. It has everything you need and it's quite easy to learn. The scripting language is either Java or VB.Net so you won't have to worry about learning a language for your tests.
I had some pretty good results with Squish from FrogLogic and didn't break the bank: http://www.froglogic.com/products/
Did you try Squsih - http://www.froglogic.com/products/index.php
OK so, let's say I have a Java applet that takes a while to load (~5 secs). It's getting the mysql-connector.jar and it's loading. Well.. instead of the gray box with the coffee logo... can I make it have a simple progress bar with the percent?
Thanks.
If you need the mysql-connector it seems like your application is fairly complex, and that you should, at least consider, using java webstart. From the faq:
How does Java Web Start relate to Java Plug-in Technology (applets)?
The two approaches are very similar. The key difference is in the user experience. If the Java application/applet needs to interact with a web page and be tightly bound to a web browser, then applets may be the solution. On the other hand, if browser independence is important, then Java Web Start is the deployment platform of choice.
If you really want to do the progress bar, this page describes a solution, but it's not trivial by any mean.