JHelp
Class JTipsDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--JHelp.JTipsDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class JTipsDialog
extends javax.swing.JDialog

This class is the Dialog that displays tips.

Example:

 // 'this' is a Frame parent object
 JTipsDialog tipsDialog = new JTipsDialog("tips.txt", this);
 tipsDialog.centerDialog();
 tipsDialog.setVisible(true);
 

Copyright (c) 2003

Document Date: 7/03

Company: Vermalt LLC

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JTipsDialog(java.io.File helpHeaderFile)
          Construct a JTipsDialog.
JTipsDialog(java.io.File helpHeaderFile, java.awt.Frame owner)
          Construct a JTipsDialog.
 
Method Summary
 void addJTipsListener(JTipsListener jTipsListener)
          Add a JTipsListener for frame close events.
 void centerDialog()
          Center this dialog on the screen.
 javax.swing.JButton getCloseButton()
          Get the JButton used for the close button.
 javax.swing.JEditorPane getJEditorPane()
          Get the JEditorPane for displaying the content tip pages.
 javax.swing.JButton getNextButton()
          Get the JButton used for the next button.
 javax.swing.JButton getPreviousButton()
          Get the JButton used for the previous button.
 javax.swing.JCheckBox getShowAtStartupCheckbox()
          Get the JCheckBox used for the show at startup check box.
 void hide()
           Hide the JTipsDialog window.
 void removeJTipsListener(JTipsListener jTipsListener)
          Remove a JTipsListener for frame close events.
 void setCharset(java.lang.String charset)
          Set the character set used to read the html tip files.
 void setCloseIcon(javax.swing.Icon icon)
          Set the icon to display in the Close button.
 void setMinimumSize(java.awt.Dimension dimension)
          Sets the minimum size of this dialog.
 void setNextIcon(javax.swing.Icon icon)
          Set the icon to display in the Next button.
 void setPreviousIcon(javax.swing.Icon icon)
          Set the icon to display in the Previous button.
 void setShowAtStartupCheckbox(boolean b)
          Set the show at startup checkbox.
 void setVisible(boolean b)
           Display or hide the JTipsDialog window.
 void show()
           Display the JTipsDialog window.
 void showIndex(int index)
          Set the tip index to display.
 
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JTipsDialog

public JTipsDialog(java.io.File helpHeaderFile)

Construct a JTipsDialog.

Parameters:
helpHeaderFile - The header file defining the list of tips data.

JTipsDialog

public JTipsDialog(java.io.File helpHeaderFile,
                   java.awt.Frame owner)

Construct a JTipsDialog.

Parameters:
helpHeaderFile - The header file defining the list of tips data
owner - The parent owner Frame
Method Detail

addJTipsListener

public void addJTipsListener(JTipsListener jTipsListener)

Add a JTipsListener for frame close events.


centerDialog

public void centerDialog()

Center this dialog on the screen.


getCloseButton

public javax.swing.JButton getCloseButton()

Get the JButton used for the close button.


getJEditorPane

public javax.swing.JEditorPane getJEditorPane()

Get the JEditorPane for displaying the content tip pages.


getNextButton

public javax.swing.JButton getNextButton()

Get the JButton used for the next button.


getPreviousButton

public javax.swing.JButton getPreviousButton()

Get the JButton used for the previous button.


getShowAtStartupCheckbox

public javax.swing.JCheckBox getShowAtStartupCheckbox()

Get the JCheckBox used for the show at startup check box.


hide

public void hide()

Hide the JTipsDialog window.

Overrides:
hide in class java.awt.Dialog

removeJTipsListener

public void removeJTipsListener(JTipsListener jTipsListener)

Remove a JTipsListener for frame close events.


setCharset

public void setCharset(java.lang.String charset)

Set the character set used to read the html tip files.

Parameters:
charset - Character set such as "UTF-16" or "UTF-8"

setCloseIcon

public void setCloseIcon(javax.swing.Icon icon)

Set the icon to display in the Close button.

Parameters:
icon - The icon to display.

setMinimumSize

public void setMinimumSize(java.awt.Dimension dimension)

Sets the minimum size of this dialog.

If user resizes below this size, the dialog will resize to the minimum.

Parameters:
dimension - The minimum size.

setNextIcon

public void setNextIcon(javax.swing.Icon icon)

Set the icon to display in the Next button.

Parameters:
icon - The icon to display.

setPreviousIcon

public void setPreviousIcon(javax.swing.Icon icon)

Set the icon to display in the Previous button.

Parameters:
icon - The icon to display.

setShowAtStartupCheckbox

public void setShowAtStartupCheckbox(boolean b)

Set the show at startup checkbox.


setVisible

public void setVisible(boolean b)

Display or hide the JTipsDialog window.

Overrides:
setVisible in class java.awt.Component
Parameters:
b - true to show, false to hide.

show

public void show()

Display the JTipsDialog window.

Overrides:
show in class java.awt.Dialog

showIndex

public void showIndex(int index)

Set the tip index to display.

The tips are indexed from 0.