summaryrefslogtreecommitdiff
path: root/src/FamilyButton.java
diff options
context:
space:
mode:
authorArghKevin <kagheli@student.sdccd.edu>2024-05-25 19:00:13 -0700
committerArghKevin <kagheli@student.sdccd.edu>2024-05-25 19:00:13 -0700
commite1fa91563afe8ea44a715508249b1027e83f2bcb (patch)
tree4b595ee869c4b6b9a26c7495f0fafd514de7d641 /src/FamilyButton.java
parenta5efa4b382a8526ce541a910c9df53a195f5f919 (diff)
Implmented interactive buttons.
Diffstat (limited to 'src/FamilyButton.java')
-rw-r--r--src/FamilyButton.java31
1 files changed, 31 insertions, 0 deletions
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;
+ }
+}