package com.dwave.gui; import javax.swing.*; import com.javaworld.BrowserControl; public class DRadioButton extends JRadioButton { /** * Creates an initially unselected radio button * with no set text. */ public DRadioButton () { this(null, null, false); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates an initially unselected radio button * with the specified image but no text. * * @param icon the image that the button should display */ public DRadioButton(Icon icon) { this(null, icon, false); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates a radiobutton where properties are taken from the * Action supplied. * * @since 1.3 */ public DRadioButton(Action a) { this(); setAction(a); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates a radio button with the specified image * and selection state, but no text. * * @param icon the image that the button should display * @param selected if true, the button is initially selected; * otherwise, the button is initially unselected */ public DRadioButton(Icon icon, boolean selected) { this(null, icon, selected); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates an unselected radio button with the specified text. * * @param text the string displayed on the radio button */ public DRadioButton (String text) { this(text, null, false); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates a radio button with the specified text * and selection state. * * @param text the string displayed on the radio button * @param selected if true, the button is initially selected; * otherwise, the button is initially unselected */ public DRadioButton (String text, boolean selected) { this(text, null, selected); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates a radio button that has the specified text and image, * and that is initially unselected. * * @param text the string displayed on the radio button * @param icon the image that the button should display */ public DRadioButton(String text, Icon icon) { this(text, icon, false); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } /** * Creates a radio button that has the specified text, image, * and selection state. * * @param text the string displayed on the radio button * @param icon the image that the button should display */ public DRadioButton (String text, Icon icon, boolean selected) { super(text, icon, selected); setBorderPainted(false); setHorizontalAlignment(LEFT); if(!BrowserControl.isWindowsPlatform()) this.setFont(new java.awt.Font("Lucida Sans", 0, 12)); } }