jTracer  1.03
Stack trace visualization tool
Button.java
Go to the documentation of this file.
1 
7 package org.libcsdbg.jtracer.installer;
8 
9 import java.awt.event.ActionListener;
10 import java.awt.Font;
11 import java.awt.Color;
12 
13 import javax.swing.JButton;
14 
18 public class Button extends JButton
19 {
21  private static final long serialVersionUID = 0x00;
22 
23 
31  Button(String text, ActionListener handler)
32  {
33  super(text);
34  Registry conf = Registry.getCurrent();
35  String nm = text.replace(" ", "_").toLowerCase() + "16.png";
36 
37  setIcon(conf.loadIcon(nm));
38  setFont((Font) conf.get("component", "font"));
39  setForeground((Color) conf.get("component", "fgcolor"));
40 
41  Integer delay = (Integer) conf.get("component", "click-delay");
42  if (delay != null)
43  setMultiClickThreshhold(delay);
44 
45  setContentAreaFilled(false);
46  setRolloverEnabled(false);
47  setActionCommand(text);
48  addActionListener(handler);
49  }
50 }
51 
Object get(String section, String key)
Get an entry.
Definition: Registry.java:106
ImageIcon loadIcon(String nm)
Load an icon from the current theme.
Definition: Registry.java:158
static final long serialVersionUID
Class version.
Definition: Button.java:21
Custom icon-text button with configurable styles.
Definition: Button.java:18