Repository navigation
Expand file tree
/
Copy pathRuleVarDialog.java
More file actions
80 lines (62 loc) · 1.89 KB
/
Copy pathRuleVarDialog.java
File metadata and controls
80 lines (62 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import java.awt.*;
public class RuleVarDialog extends Dialog {
void button1_Clicked(Event event) {
answer = textField1.getText() ; // set
}
void button2_Clicked(Event event) {
answer = "" ;
textField1.setText("") ;
}
public RuleVarDialog(Frame parent, boolean modal) {
super(parent, modal);
//{{INIT_CONTROLS
setLayout(null);
addNotify();
resize(insets().left + insets().right + 352,insets().top + insets().bottom + 214);
label1 = new java.awt.Label("");
label1.reshape(insets().left + 0,insets().top + 12,407,61);
add(label1);
textField1 = new java.awt.TextField();
textField1.setText("");
textField1.reshape(insets().left + 192,insets().top + 84,97,39);
add(textField1);
button1 = new java.awt.Button("Set");
button1.reshape(insets().left + 24,insets().top + 144,124,41);
add(button1);
setTitle("Rule Applet -- Ask User");
//}}
}
public RuleVarDialog(Frame parent, String title, boolean modal) {
this(parent, modal);
setTitle(title);
}
public boolean gotFocus(Event e, Object arg) {
textField1.requestFocus();
return false;
}
public synchronized void show() {
Rectangle bounds = getParent().bounds();
Rectangle abounds = bounds();
move(bounds.x + (bounds.width - abounds.width)/ 2, bounds.y + (bounds.height - abounds.height)/2);
super.show();
}
public boolean handleEvent(Event event) {
// bug workaround --- 1004 is button press ???
if ( event.id == 1004 & event.target == button1 ) {
button1_Clicked(event); // set
hide() ;
dispose() ;
return true ;
}
return super.handleEvent(event);
}
public String getText() {
return answer;
}
//{{DECLARE_CONTROLS
java.awt.Label label1;
java.awt.TextField textField1;
java.awt.Button button1;
//}}
String answer = new String("") ;
}