All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.netobjects.nfx.util.MsgBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Dialog
                                   |
                                   +----com.sun.java.swing.JDialog
                                           |
                                           +----com.netobjects.nfx.util.MsgBox

public class MsgBox
extends JDialog
implements ActionListener
Message box utility class which expands to the "max-width" as more text is added. The pixel-width of the given text is determined and the message box is resized accordingly up to the max-width where a scrollable text pane is used instead of a on-line label. In this case the window width reverts to the standard-width, and the height is increased.

Version:
1.0
Author:
Scott Cinnamond

Variable Index

 o dmBtnLabelOk
The OK label.
 o dmBtnOk
The ok button.
 o dmMaxWidth
Max width we want the window, a bit less than an 800x600 screen.
 o dmMsg
The message.
 o dmStandardHeight
The dialog standard height.
 o dmStandardPad
The pixel pad value used to
 o dmStandardWidth
The dialog standard width.

Constructor Index

 o MsgBox(Frame, String, String)
Constructor.
 o MsgBox(Frame, String, String, int, int)
Constructor.

Method Index

 o actionPerformed(ActionEvent)
Handle control events.
 o addListeners()
 o createControls()
 o main(String[])
 o toPixels(String)
 o windowClosing(WindowEvent)
Processes a window close event.

Variables

 o dmBtnOk
 private JButton dmBtnOk
The ok button.

 o dmMsg
 private String dmMsg
The message.

 o dmBtnLabelOk
 private static final String dmBtnLabelOk
The OK label.

 o dmStandardWidth
 private int dmStandardWidth
The dialog standard width.

 o dmStandardHeight
 private int dmStandardHeight
The dialog standard height.

 o dmStandardPad
 private static final int dmStandardPad
The pixel pad value used to

 o dmMaxWidth
 private int dmMaxWidth
Max width we want the window, a bit less than an 800x600 screen.

Constructors

 o MsgBox
 public MsgBox(Frame parent,
               String title,
               String msg)
Constructor.

Parameters:
parent - the dialog parent frame.
title - the dialog title.
msg - the message.
 o MsgBox
 public MsgBox(Frame parent,
               String title,
               String msg,
               int width,
               int height)
Constructor.

Parameters:
parent - the dialog parent frame.
title - the dialog title.
msg - the message.
width - the dialog width.
height - the dialog height.

Methods

 o createControls
 protected void createControls()
 o addListeners
 protected void addListeners()
 o toPixels
 protected int toPixels(String s)
 o windowClosing
 public void windowClosing(WindowEvent event)
Processes a window close event.

Parameters:
event - the window event.
 o actionPerformed
 public void actionPerformed(ActionEvent event)
Handle control events.

 o main
 public static void main(String argv[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index