2

This is the html I would like to display: http://boba.dyndns-server.com/Degrees/Art_History_Track_BA.html

I would also like to display this google calendar as well. (but this link is not a priority)

I have looked into the DJProject and it appears to require win32 computer, however I would like the program to work on mac and windows. If I am wrong about DJProject, could you please explain me how to implement their Simple Example using a Eclipse on a Mac.

My goal is to embed the link into a JScrollPanel, with as little overhead as possible. Thanks for any and all suggestions.

**JEditor Pane can display html, but not html with css in the htmls.

***If you know of away to remove css, I would like to consider that as well

** The htmls I want to display were generated by a pdf converter.

Alerty
  • 5,945
  • 7
  • 38
  • 62
Steven Feldman
  • 833
  • 1
  • 15
  • 28

3 Answers3

2

You can use SWT Browser directly :


import org.eclipse.swt.*;
import org.eclipse.swt.browser.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class Main {
    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());
        Browser browser = new Browser(shell, SWT.NONE);
        browser.setUrl("http://printf.ru/");
        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
    }
}

For customization : http://www.eclipse.org/swt/snippets/
A full tutorial : http://www.eclipse.org/articles/Article-SWT-browser-widget/browser.html

Stephan
  • 41,764
  • 65
  • 238
  • 329
0

I don't know about CSS, but HTML can be used in Java Swing components: see The Java Tutorials.

The Google Calendar would probably require the use of the Google Calendar Client Library.

Richard JP Le Guen
  • 28,364
  • 7
  • 89
  • 119
  • Swing does support some CSS, but not the CSS in the html pages. Google Calendar Client Library is on how to interact with a calendar, not display it. – Steven Feldman Mar 17 '11 at 16:29
0

You could embed a JWebPane into your application.

See this post for more information on this approach.

Is there a way to embed a browser in Java?

Community
  • 1
  • 1
Holograham
  • 1,348
  • 1
  • 13
  • 34