-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestionTest.java
More file actions
31 lines (26 loc) · 877 Bytes
/
QuestionTest.java
File metadata and controls
31 lines (26 loc) · 877 Bytes
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
import javax.swing.JFrame;
import javax.swing.JTree;
/**
* Tests DNSQuestionImpl and DNSQuestionGuiDecorator.
*
* @author Chris Blades
* @version 20/3/2010
*/
public class QuestionTest {
public static void main(String[] args) {
DNSQuestion question = new DNSQuestionImpl();
DNSUrl url = new DNSUrlImpl("www.google.com");
DNSRecordType type = DNSRecordTypeEnum.A;
DNSRecordClass clss = DNSRecordClassEnum.IN;
question.setName(url);
question.setType(type);
question.setClass(clss);
DNSQuestionGuiDecorator dec =
new DNSQuestionGuiDecorator(question);
JFrame frame = new JFrame("DNS Resolver");
frame.setSize(300, 500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new JTree(dec));
frame.setVisible(true);
}
}