01: /*
02: * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
03: *
04: * See the file "LICENSE.txt" for information on usage and redistribution of
05: * this file, and for a DISCLAIMER OF ALL WARRANTIES.
06: */
07: package org.pnuts.tools;
08:
09: import java.awt.Color;
10: import java.awt.Font;
11: import javax.swing.JTextField;
12: import pnuts.tools.ContextEvent;
13: import pnuts.tools.ContextListener;
14:
15: public class ClassLoaderView extends JTextField implements
16: ContextListener {
17: private final static Font monospaced = Font.getFont("monospaced");
18:
19: public ClassLoaderView() {
20: super (20);
21: setFont(monospaced);
22: setAutoscrolls(true);
23: setEditable(false);
24: setSelectionColor(Color.white);
25: setBackground(Color.white);
26: }
27:
28: public void update(ContextEvent event) {
29: setText(String.valueOf(event.getContext().getClassLoader()));
30: }
31: }
|