Home arrow Java & J2EE arrow Page 4 - Java Help Files

Enhancements - Java

Help screens are a necessity for making any application user-friendly. This article will show how the JEditorPane and JFrame classes, along with HTML files, can be used to create help windows for any Java application. This is a project-oriented article that will walk the reader through all the code needed for development. Some familiarity with Java is assumed.

TABLE OF CONTENTS:
  1. Java Help Files
  2. The Code
  3. The HelpWindow Class
  4. Enhancements
By: Peter Lavin
Rating: starstarstarstarstar / 67
July 21, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The class we’ve created is a very basic use of JEditorPane to display HTML help files. There are numerous ways in which it could be improved and I will make a few suggestions here. Buttons to navigate to previously visited URLs might be helpful. A menubar might provide a more elegant means of navigation.

Remember also that this class retains all the functionality of its parent. If you are not satisfied with the size of the window, you can simply use the “setSize” method inherited from the JFrame class. Likewise with methods such as “setBackground”. Furthermore, the functionality of this class could be extended by deriving other classes from it. That said, it is best to remember that Java only supports HTML version 3.2, and this fact will certainly restrict what can be achieved.

Finally, the way in which exceptions are handled could be improved. In a follow-up article we will show how to construct a generic class to handle exceptions thrown by any Java application.

To summarize, we have presented a class that creates a basic help window and can be incorporated into any Java application. In so doing we have achieved one of the goals of object-oriented programming – namely creating a reusable class.



 
 
>>> More Java & J2EE Articles          >>> More By Peter Lavin
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

JAVA & J2EE ARTICLES

- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: