From e1fa91563afe8ea44a715508249b1027e83f2bcb Mon Sep 17 00:00:00 2001 From: ArghKevin Date: Sat, 25 May 2024 19:00:13 -0700 Subject: Implmented interactive buttons. --- src/FamilyButton.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/FamilyButton.java (limited to 'src/FamilyButton.java') diff --git a/src/FamilyButton.java b/src/FamilyButton.java new file mode 100644 index 0000000..994e848 --- /dev/null +++ b/src/FamilyButton.java @@ -0,0 +1,31 @@ +import javax.swing.JToggleButton; + +/* + * @author + * Kian Agheli + * + * References: + * https://www.geeksforgeeks.org/java-swing-jtogglebutton-class/ + * + * Date: + * 2024-05-25 + * + * Purpose of class: + * Provide an interative button to toggle FontFamily metadata. + */ + +public class FamilyButton extends JToggleButton { + private FontFamily family; // A FamilyButton has-a font family + + public FamilyButton(FontFamily family) + { + this.family = family; // Set family to provided + } + + /** + * Return the FontFamily associated with the instantiated button. + */ + public FontFamily getFamily() { + return family; + } +} -- cgit v1.2.3