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/MetadataView.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/MetadataView.java (limited to 'src/MetadataView.java') diff --git a/src/MetadataView.java b/src/MetadataView.java new file mode 100644 index 0000000..5837aca --- /dev/null +++ b/src/MetadataView.java @@ -0,0 +1,35 @@ +import javax.swing.JTextArea; +import java.awt.*; + +/* + * @author + * Kian Agheli + * + * References: + * https://docs.oracle.com/javase/tutorial/uiswing/components/textarea.html + * + * Date: + * 2024-05-25 + * + * Purpose of class: + * Provide an area to show metadata. + */ + +public class MetadataView extends JTextArea { + // A MetadataView has-a default text. + private final String defaultText = "Toggle a font family using a colorful button below.\n" + + "Each color corresponds with a line on the graph to the right.\n" + + "The graph tracks monthly views."; + + public MetadataView() { + super(); // Call parent constructor + setEditable(false); // Disable editing of the widget. + setFocusable(false); // Disable focusing of the widget. + setText(defaultText); // Set to the default text. + } + + /* Reset the MetadataView. Set the text to the default. */ + public void reset() { + setText(defaultText); + } +} -- cgit v1.2.3