01: package tools.tracesviewer;
02:
03: import javax.swing.*;
04: import java.awt.*;
05: import java.awt.event.*;
06:
07: public class DebugWindow extends javax.swing.JFrame {
08:
09: public JPanel mainPanel;
10: public JButton okButton;
11:
12: public DebugWindow(String beforeDebug, String afterDebug,
13: String title) {
14: super ("Debug window: Debug Log Line " + title);
15:
16: initComponents(beforeDebug, afterDebug);
17: }
18:
19: public void initComponents(String beforeDebug, String afterDebug) {
20: /********************** The main container ****************************/
21:
22: Container container = this .getContentPane();
23:
24: container.setBackground(Color.black);
25: this .setSize(700, 550);
26: this .addWindowListener(new WindowAdapter() {
27: public void windowClosing(WindowEvent e) {
28:
29: }
30: });
31:
32: /*************************** MAIN PANEL ********************************/
33:
34: mainPanel = new JPanel();
35: // If put to False: we see the container's background
36: mainPanel.setOpaque(false);
37: mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.X_AXIS));
38: container.add(mainPanel);
39:
40: JTextArea beforeDebugTextArea = new JTextArea();
41: beforeDebugTextArea.setEditable(false);
42: beforeDebugTextArea.setFont(new Font("Dialog", 1, 12));
43: beforeDebugTextArea.setForeground(Color.black);
44: beforeDebugTextArea
45: .setText("***********************************************\n"
46: + "STACK TRACE BEFORE \n"
47: + " THE SIP MESSAGE\n"
48: + "***********************************************\n\n"
49: + beforeDebug);
50: ScrollPane scrollBefore = new ScrollPane(
51: ScrollPane.SCROLLBARS_ALWAYS);
52: scrollBefore.add(beforeDebugTextArea);
53: mainPanel.add(scrollBefore);
54:
55: JTextArea afterDebugTextArea = new JTextArea();
56: afterDebugTextArea.setEditable(false);
57: afterDebugTextArea.setFont(new Font("Dialog", 1, 12));
58: afterDebugTextArea.setForeground(Color.black);
59: afterDebugTextArea
60: .setText("************************************************\n"
61: + "STACK TRACE AFTER \n"
62: + " THE SIP MESSAGE\n"
63: + "************************************************\n\n"
64: + afterDebug);
65: ScrollPane scrollAfter = new ScrollPane(
66: ScrollPane.SCROLLBARS_ALWAYS);
67: scrollAfter.add(afterDebugTextArea);
68: mainPanel.add(scrollAfter);
69:
70: }
71:
72: }
|