Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package tools.tracesviewer;
 
 import javax.swing.*;
 import java.awt.*;
 
 public class DebugWindow extends javax.swing.JFrame {
 
     public JPanel mainPanel;
    public JButton okButton;
    public DebugWindow(String beforeDebugString afterDebugString title) {
        super("Debug window: Debug Log Line " + title);
        initComponents(beforeDebugafterDebug);
    }
    public void initComponents(String beforeDebugString afterDebug) {
        
The main container **************************
        Container container = this.getContentPane();
        container.setBackground(.);
        this.setSize(700, 550);
        this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
            }
        });

        
MAIN PANEL ******************************
         = new JPanel();
        // If put to False: we see the container's background
        .setOpaque(false);
        container.add();
        JTextArea beforeDebugTextArea = new JTextArea();
        beforeDebugTextArea.setEditable(false);
        beforeDebugTextArea.setFont(new Font("Dialog", 1, 12));
        beforeDebugTextArea.setForeground(.);
        beforeDebugTextArea.setText(
            "***********************************************\n"
                + "STACK TRACE BEFORE \n"
                + " THE SIP MESSAGE\n"
                + "***********************************************\n\n"
                + beforeDebug);
        ScrollPane scrollBefore = new ScrollPane(.);
        scrollBefore.add(beforeDebugTextArea);
        .add(scrollBefore);
        JTextArea afterDebugTextArea = new JTextArea();
        afterDebugTextArea.setEditable(false);
        afterDebugTextArea.setFont(new Font("Dialog", 1, 12));
        afterDebugTextArea.setForeground(.);
        afterDebugTextArea.setText(
            "************************************************\n"
                + "STACK TRACE AFTER \n"
                + " THE SIP MESSAGE\n"
                + "************************************************\n\n"
                + afterDebug);
        ScrollPane scrollAfter = new ScrollPane(.);
        scrollAfter.add(afterDebugTextArea);
        .add(scrollAfter);
    }
New to GrepCode? Check out our FAQ X