1 6 7 package com.quikj.application.utilities.postinstall; 8 9 import java.awt.*; 10 11 15 public class HelpFrame extends java.awt.Frame 16 { 17 18 19 public HelpFrame(Frame parent) 20 { 21 initComponents(); 22 23 Rectangle pbounds = parent.getBounds(); 24 Point mid = new Point(pbounds.x + pbounds.width, pbounds.y); 25 Rectangle bounds = getBounds(); 26 setBounds(mid.x, mid.y, bounds.width, bounds.height); 27 28 instance = this; 29 } 30 31 public static HelpFrame getInstance() 32 { 33 return instance; 34 } 35 36 public void setText(String text) 37 { 38 helpArea.setText(text); 39 40 if (isShowing() == false) 41 { 42 show(); 43 } 44 } 45 46 51 private void initComponents() { 53 java.awt.GridBagConstraints gridBagConstraints; 54 55 helpArea = new TextArea("", 20, 70, TextArea.SCROLLBARS_VERTICAL_ONLY); 56 button1 = new java.awt.Button (); 57 58 setLayout(new java.awt.GridBagLayout ()); 59 60 setTitle("Ace Operator Post-Installation Help"); 61 addWindowListener(new java.awt.event.WindowAdapter () 62 { 63 public void windowClosing(java.awt.event.WindowEvent evt) 64 { 65 exitForm(evt); 66 } 67 }); 68 69 helpArea.setEditable(false); 70 gridBagConstraints = new java.awt.GridBagConstraints (); 71 gridBagConstraints.gridx = 0; 72 gridBagConstraints.gridy = 0; 73 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 74 gridBagConstraints.insets = new java.awt.Insets (10, 10, 10, 10); 75 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 76 gridBagConstraints.weightx = 100.0; 77 gridBagConstraints.weighty = 100.0; 78 add(helpArea, gridBagConstraints); 79 80 button1.setLabel("Close"); 81 button1.addActionListener(new java.awt.event.ActionListener () 82 { 83 public void actionPerformed(java.awt.event.ActionEvent evt) 84 { 85 button1ActionPerformed(evt); 86 } 87 }); 88 89 gridBagConstraints = new java.awt.GridBagConstraints (); 90 gridBagConstraints.gridx = 0; 91 gridBagConstraints.gridy = 1; 92 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 93 gridBagConstraints.insets = new java.awt.Insets (0, 10, 10, 10); 94 gridBagConstraints.weightx = 100.0; 95 add(button1, gridBagConstraints); 96 97 pack(); 98 } 100 private void button1ActionPerformed(java.awt.event.ActionEvent evt) { hide(); 104 } 106 107 private void exitForm(java.awt.event.WindowEvent evt) 108 { hide(); 110 } 112 private java.awt.Button button1; 114 private java.awt.TextArea helpArea; 115 117 private static HelpFrame instance = null; 118 } 119 | Popular Tags |