Capstone 2004 - PowerPoint PPT Presentation

About This Presentation
Title:

Capstone 2004

Description:

Java's swing component is capable of displaying HTML pages. ... catch (IOException e) { System.err.println('Attempted to read a bad URL: ' helpURL) ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 12
Provided by: krishn3
Category:

less

Transcript and Presenter's Notes

Title: Capstone 2004


1
Capstone 2004
  • Viewing HTML in Java
  • Dashboard Implicit Query
  • Presenter Krishnan Ram

2
Displaying HTML In Java Window
  • First- Why is this important?
  • Virtual Classroom
  • Ability to surf to work-related hyperlinks while
    viewing a lecture
  • Virtual NYC
  • Ability to link locations to websites
  • Eg. Clicking on Pizza Hut can open the Pizza Hut
    website.

3
Java
  • Javas swing component is capable of displaying
    HTML pages.
  • HTML pages are viewed using a JEditorPane
  • This supports styled text.

4
JEditorPane
  • Currently knows about 3 types of content
  • text/plain-uses DefaultEditorKit
  • Editor Kits are contain classes that write
    content to the JEditorPane.
  • text/html-uses HTMLEditorKit
  • text/rtf-uses RTFEditorKit

5
HTMLEditorKit
  • This kit contains classes for displaying various
    html objects.
  • How it works?
  • Load a HTML file into the JEditorPane object and
    the editor kit will dictate how the HTML objects
    are displayed in the window-very similar to a web
    browser.
  • In fact, I found a very simple Java web browser
    that uses a JEditorPane for its display.

6
Example of Code
private JEditorPane createEditorPane()
JEditorPane editorPane new JEditorPane()
editorPane.setEditable(false)
java.net.URL helpURL TextSamplerDemo.class.getRe
source( "google.html") if (helpURL !
null) try
editorPane.setPage(helpURL) catch
(IOException e)
System.err.println("Attempted to read a bad URL
" helpURL) else
System.err.println("Couldn't find file
TextSampleDemoHelp.html")
return editorPane
7
References
  • Using Text Components http//java.sun.com/docs/boo
    ks/tutorial/uiswing/components/text.html
  • Java API http//java.sun.com/j2se/1.5.0/docs/api/
  • Javaworld.com http//www.javaworld.com/javaworld/j
    w-01-1999/jw-01-swing.html

8
Dashboard Implicit Query
  • Dashboard- Linux
  • Implicit Query- Mircrosoft
  • Both have same principles
  • Instantaneous and continuous search of your
    workspace for relevant objects

9
Dashboard Implicit Query
  • Idea
  • Dashboard/Implicit Query continuously monitor
    you current workspace, all open windows such as
    chat windows websites and searches for keywords
    or cluewords and will return any possible
    relevant information on those keywords to the
    Dashboard interface.

10
(No Transcript)
11
Example
Nat Friedman-ximian.com
Write a Comment
User Comments (0)
About PowerShow.com