]> scm.dxcluster.org Git - spider.git/blob - spider-web/dxannounce.java
c4c833f554cf4cb175b289fd76d4277e36ff08d5
[spider.git] / spider-web / dxannounce.java
1 import java.awt.*;
2
3 public class dxannounce extends Dialog 
4 {
5         public dxannounce(spiderframe parent, String Call2, 
6                                  String Freq, String Remarks, Font font) {
7                 super(parent, "Dx Announce", true);
8                 this.parent = parent;
9                 this.setFont(font);
10 //              Call2 = "";
11 //              Freq = "";
12 //              Remarks = ""; // Make sure that Call2, Freq and Remarks are empty when box is displayed.
13                 
14                 Panel p1 = new Panel();
15                 p1.setLayout(new GridLayout(3,2));
16                 p1.add(new Label("Call: "));
17                 p1.add(call2 = new TextField(Call2,6));
18                 p1.add(new Label("Freq. in khz: "));
19                 p1.add(freq = new TextField(Freq));
20                 p1.add(new Label("Remarks"));
21                 p1.add(remarks = new TextField(Remarks,15));
22                 add("North", p1);
23                 
24                 // Panel p3 = new Panel();
25                 // p3.add(new Label("Remarks"));
26                 // p3.add(freq = new TextField(Remarks,30));
27                 // add("Center",p3);
28
29                 Panel p2 = new Panel();
30                 p2.add(new Button("OK"));
31                 p2.add(new Button("Cancel"));
32                 add("South", p2);
33                 
34                 resize(250,150);
35                 
36                 show();
37         }
38         
39         public boolean action(Event evt, Object arg) {
40                 if (arg.equals("OK")) {
41                         dispose();
42                         parent.setCall2(call2.getText());
43                         parent.setFreq(freq.getText());
44                         parent.setRemarks(remarks.getText());
45                 }
46
47                 else if (arg.equals("Cancel")) {
48                         dispose();
49                 }
50                 else return super.action(evt, arg);
51                 return true;
52         }
53         
54         private TextField call2;
55         private TextField freq;
56         private TextField remarks;      
57         private Font font = new Font("Courier" , Font.PLAIN ,16);
58         private spiderframe parent;
59 }