package com.dwave.gui;
import javax.swing.JButton;
import javax.swing.Icon;
import javax.swing.Action;
import java.awt.Font;
import com.javaworld.BrowserControl;
/**
* A Serializable JButton which uses the Lucida Sans font by
* default because fonts on linux are wierd
*/
public class DButton extends JButton implements java.io.Serializable {
private static final long serialVersionUID = -757087513022738653L;
/**
* Construct a button
*/
public DButton() {
super();
if(!BrowserControl.isWindowsPlatform())
this.setFont(new java.awt.Font("Lucida Sans", 1, 10));
}
/**
* Construct a button with an icon
* @param icon an icon
*/
public DButton(Icon icon) {
super(icon);
if(!BrowserControl.isWindowsPlatform())
this.setFont(new java.awt.Font("Lucida Sans", 1, 10));
}
/**
* Construct a button with text
* @param text some text
*/
public DButton(String text) {
super(text);
if(!BrowserControl.isWindowsPlatform())
this.setFont(new java.awt.Font("Lucida Sans", 1, 10));
}
/**
* Construct a button with an action.
* * IMPORTANT: Only works with jdk1.3+ * @param a an action */ public DButton(Action a) { super(a); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 1, 10)); } /** * Construct a button with text and an icon * @param text some text * @param icon an icon */ public DButton(String text, Icon icon) { super(text, icon); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 1, 10)); } }