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.

3
  • Is this for a desktop GUI or for an applet in a browser? Commented Mar 17, 2011 at 15:41
  • @Seteven Feldman - I'm goign to remove the [applet] tag then ;) Commented Mar 17, 2011 at 16:31
  • Why would you roll back an obvious typo fix? Commented Mar 17, 2011 at 17:27

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

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.
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?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.