Mercurial > repos > timpalpant > java_genomics_toolkit
diff java-genomics-toolkit/gui/edu/unc/genomics/ButtonLabel.java @ 0:1daf3026d231
Upload alpha version
author | timpalpant |
---|---|
date | Mon, 13 Feb 2012 21:55:55 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java-genomics-toolkit/gui/edu/unc/genomics/ButtonLabel.java Mon Feb 13 21:55:55 2012 -0500 @@ -0,0 +1,50 @@ +package edu.unc.genomics; + +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JButton; + +/** + * Act like a button, look like a label + * + * @author timpalpant + * + */ +public class ButtonLabel extends JButton { + + private static final long serialVersionUID = -4449260534784095223L; + + public ButtonLabel() { + init(); + } + + public ButtonLabel(Icon icon) { + super(icon); + init(); + } + + public ButtonLabel(String text) { + super(text); + init(); + } + + public ButtonLabel(Action a) { + super(a); + init(); + } + + public ButtonLabel(String text, Icon icon) { + super(text, icon); + init(); + } + + private void init() { + setBorder(BorderFactory.createEmptyBorder()); + setBorderPainted(false); + setContentAreaFilled(false); + setFocusPainted(false); + setOpaque(false); + } + +}