7 package org.libcsdbg.jtracer;
9 import java.awt.event.MouseEvent;
10 import java.awt.event.MouseListener;
11 import java.awt.event.ActionListener;
13 import java.awt.Color;
15 import javax.swing.JButton;
20 public class Button extends JButton implements MouseListener
35 Button(String nm, String cmd, ActionListener handler)
38 Registry conf = Registry.getCurrent();
41 Integer delay = (Integer) conf.
get(
"component",
"click-delay");
43 setMultiClickThreshhold(delay);
46 setContentAreaFilled(
false);
47 setBorderPainted(
false);
48 setRolloverEnabled(
false);
50 setActionCommand(cmd);
51 addActionListener(handler);
52 addMouseListener(
this);
69 Button(String nm, String text,
int htpos,
int vtpos, ActionListener handler)
72 Registry conf = Registry.getCurrent();
75 setFont((Font) conf.
get(
"component",
"font"));
76 setForeground((Color) conf.
get(
"component",
"fgcolor"));
78 Integer delay = (Integer) conf.
get(
"component",
"click-delay");
80 setMultiClickThreshhold(delay);
82 setHorizontalTextPosition(htpos);
83 setVerticalTextPosition(vtpos);
84 setContentAreaFilled(
false);
85 setBorderPainted(
false);
86 setRolloverEnabled(
false);
88 setActionCommand(text);
89 addActionListener(handler);
90 addMouseListener(
this);
101 Button(String text, ActionListener handler)
104 Registry conf = Registry.getCurrent();
106 setFont((Font) conf.get(
"component",
"font"));
107 setForeground((Color) conf.get(
"component",
"fgcolor"));
109 Integer delay = (Integer) conf.
get(
"component",
"click-delay");
111 setMultiClickThreshhold(delay);
113 setContentAreaFilled(
false);
114 setActionCommand(text);
115 addActionListener(handler);
127 if (!how && getIcon() != null)
128 setBorderPainted(
false);
130 super.setEnabled(how);
143 setBorderPainted(
true);
146 catch (Throwable t) {
160 setBorderPainted(
false);
163 catch (Throwable t) {
Object get(String section, String key)
Get an entry.
ImageIcon loadIcon(String nm)
Load an icon from the current theme.