I want to embed google maps on a JPanel. Since I want features like zoom-in/out, using static images isn't feasible.
To achieve this, I'll probably need to embed a webpage (which displays google maps) in my Java desktop application. And I've read that I'll need something like WebKit (alternatives?) to accomplish this.
I'd appreciate any help that'll help me:
Embed a webpage in a Jpanel.
That webpage to display google maps.
Yes, the Google Maps APIs can now be used in Desktop applications
Check out these Stack Overflow threads:
Google Map in JAVA Swing
Embedding Gecko/Webkit in Java
Webkit browser in a Java app
Rendering webpages with WebKit in Java
You can also see the tutorail of using Maps in Java Desktop Application.
You can use JxMaps library to complete this task. It has Swing component which can be simply embedded to JPanel.
void createMapView(JPanel parent) {
MapView view = new MapView();
parent.add(view);
}
This library has comprehensive set of classes for working with Google Maps from java.
I am looking for an open source browser component like the ones in DJ Project (http://djproject.sourceforge.net/ns/index.html) for SWING. I tried using DJ Project (which I learned about from Best Java/Swing browser component?), but I noticed that it hasn't been updated in recent months.
If there is an easy way to make a web browser using JInternalFrame, that would be awesome as well.
Thank you in advance!
I just want to know if it is possible in Java to create a frame which is located between the desktop background and the icons on it.
Basically I try to create an "animated desktop background" in Java using Windows 7.
I found some tutorials on how to create a fully transparent window, but the problem remaining is, that this window is still in front of the desktop icons, so its more like a "desktop foreground".
Is there a way to make this foreground to a background?
Are there other ways to achieve this in "pure" Java?
But I guess the only way realizing it with Java is native code via JNI/JNA.
Hopefully you can tell me that I'm wrong ;)
You cannot do it using Swing/AWT. Since the windows api is in c++, it is possible to call some of the functions using JNI.
I have added JavaHelp to my web application, but now I need to include videos in the content (html)files. As far as I can read here I need to implement a lightweight component, and I can use the video viewer included in the Java 2 platform, but I am lost as to how to that.
Can anyone here walk me through the steps necessary to implement this?
As far as I can tell I need to
include an applet using the tags.
write the applet, basing it on the Java 2 video viewer
pack the applet??
I hope one of you has experience with this.
I have seen a lot of people try to make a web ui looks like a desktop ui. However, most of the time i feel web ui is much more interesting than the desktop ui, with the help of javascript toolkit like jquery, gwt-ext etc.
My question is, how to port the web ui to desktop ui? Do I need to embed a javascript engine in java? css engine? html layout engine? That sounds like a lot of work to do.
Any easy way of doing this?
you can embed a web server in your app and you can embed a browser inside your app window. i know eclipse does this pretty well. it uses SWT to do the heavy lifting
http://www.eclipse.org/swt/snippets/#browser
check the Browser section
your web server doesnt even have to be a proper web server, it just has to set the content, and can query / change it on the fly. the javascript on the page can even interact directly with your app.
you should be even able to use crazy web frameworks like
http://echo.nextapp.com/site/
or
http://code.google.com/webtoolkit/
or even run a ruby site through JRUBY
or make really complex apps using the new HTML5 engine [canvas/video tags] (if your client has the new mozilla installed)
Adobe AIR technology solves this exact problem. The code you develop using Flex can be rendered in the Flash player plugin of a browser or the same code can be easily packaged as a Desktop application that runs on the AIR runtime.
Have you seen Appcelerator's Titanium Desktop
This is one of the best solution for you (i think!)
You write the javascript and html code, and the titanium SDK creates the Desktop application of the same
There is support for Python and Ruby.
Must try :
http://www.appcelerator.com/products/titanium-desktop/
if you are a Ruby programmer then you must also see this
http://www.rubyinside.com/bowline-rails-for-the-desktop-2183.html
Prism from Mozilla is made for this goal, exactly. It's out of beta now too, I believe.
Check Google Gears y Adobe AIR
It not 'a lot of work to do', it's a huge amount of work to do - you would in effect be writing you own browser and it'd never come close to the poplar ones out there, simply because you wouldn't get the level of feedback something like Firefox gets.
If you're trying to avoid address bars, menu bars, etc these can be switched off in all the popular browsers and so to the user the appearance would be that it's more application like with only the rich content of the HTML visible.
Sounds like JavaFX would be good for you?
http://en.wikipedia.org/wiki/Javafx
Try XULRunner from Mozilla. If you have developed extensions for Firefox, then this is the exact same thing. XULRunner contains the Gecko engine, so it can render XUL and HTML with CSS, and it supports JavaScript with many useful XUL Components, like file read and write, directory browser and network tools.
Because it supports HTML you can in effect make a webpage and have it run like an application. Also it is cross platform, so it will run on Windows, Mac and Linux, anywhere Firefox runs actually.
There is some information on creating XULRunner applications on the net, but since it's so similar to making Firefox Extensions, you can just google for that. A good Tutorial for getting started is this one.