3 package org.bitstorm.util;
6 import java.awt.AWTEvent;
7 import java.awt.Button;
9 import java.awt.Dialog;
10 import java.awt.Event;
11 import java.awt.FlowLayout;
12 import java.awt.Frame;
13 import java.awt.Panel;
14 import java.awt.TextArea;
15 import java.awt.event.ActionEvent;
16 import java.awt.event.ActionListener;
17 import java.io.IOException;
33 public TextFileDialog( Frame parent, String title, String filename,
int posX,
int posY ) {
34 super( parent, title );
36 Button okButton =
new Button(
" Close ");
37 okButton.addActionListener(
38 new ActionListener() {
39 public void actionPerformed(ActionEvent e) {
45 EasyFile file =
new EasyFile( this.getClass().getResourceAsStream( filename ) );
48 }
catch (IOException e) {
52 TextArea manualTextArea =
new TextArea( manualText, 20, 50, TextArea.SCROLLBARS_VERTICAL_ONLY );
53 manualTextArea.setBackground( Color.white );
54 manualTextArea.setForeground( Color.black );
55 manualTextArea.setEditable(
false);
57 Panel buttonPanel =
new Panel();
58 buttonPanel.setLayout(
new FlowLayout( FlowLayout.CENTER ) );
59 buttonPanel.add( okButton );
61 this.add(
"Center", manualTextArea );
62 this.add(
"South", buttonPanel );
64 this.enableEvents(Event.WINDOW_DESTROY);
65 this.setLocation( posX, posY );
82 if ( e.getID() == Event.WINDOW_DESTROY )
void processEvent(AWTEvent e)
TextFileDialog(Frame parent, String title, String filename, int posX, int posY)