Here are all the code snippets from the demo application: click on their name to see the corresponding source code.
To see them running, download the DJ Sweet distribution and launch the demo application (you can also see the source code of the snippets with syntax highlighting in the demo).
This is a simple example that shows the basic configuration of an embedded web browser component.
Set any HTML content to the web browser.
Execute some Javascript code in the current web browser page.
Control the navigation happening in the web browser from the Java application. This allows to block certain links and/or the creation of new windows, or to open links and/or new windows elsewhere.
Use static links or simple Javascript to send some commands with arguments to the application: function sendCommand(command) { var s = 'command://' + encodeURIComponent(command); for(var i=1; i<arguments.length; s+='&'+encodeURIComponent(arguments[i++])); window.location = s; }
Load web pages from the classpath with the help of the embedded simple web server.
Toggle edition mode of a web page by accessing the Mozilla interfaces using XPCOM.
Modify the browser's download manager using Mozilla XPCOM.
Display a Flash application.
Control the flow of a Flash animation, and get/set global variables.
Invoke functions, with or without waiting for a result, and listen to Flash commands.
Load a movie/sound file to an embedded VLC player.
Graphically edit some HTML, get and set the HTML content.
Modify default behaviors with custom configuration script.
Use the TinyMCE editor implementation instead of the default FCKeditor.
Display some content with syntax highlighting from one of the available languages (C++, C#, css, Delphi, Java, JS, PHP, Python, Ruby, SQL, VB, XML, HTML).
Load a movie/sound file to an embedded multimedia player.