package cs380.DrWebster.Assignment1; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; /** * MyPanelTop creates the graphical user interface of the program */ public class MyPanelTop extends JPanel { Button outputButton; Button statisticsButton; Button threadStatButton; boolean output = false; TextArea textarea = new TextArea(); TextArea stackTextArea = new TextArea("Current stack:\n - "); JPanel mypanel = new JPanel(); public MyPanelTop() { this.setLayout(new BorderLayout()); JPanel textPanel = new JPanel(); textPanel.setLayout(new GridLayout(1, 2)); textarea.setFont(new Font("Helvetica", Font.PLAIN, 12)); textarea.setEditable(false); textarea.setSize(100, 100); stackTextArea.setFont(new Font("Helvetica", Font.PLAIN, 12)); stackTextArea.setEditable(false); stackTextArea.setSize(100, 100); textPanel.add(textarea); textPanel.add(stackTextArea); // create control buttons // this.setLayout(null); // set layout to null // /////////////////////// // outputButton = new Button("Pause Output"); // statisticsButton = new Button("View Statistics"); // threadStatButton = new Button("View Thread Stats"); // mypanel.add(outputButton); // mypanel.add(statisticsButton); // mypanel.add(threadStatButton); textarea.setFont(new Font(Font.MONOSPACED, Font.BOLD, 16)); this.add(textPanel, BorderLayout.CENTER); this.add(mypanel, BorderLayout.SOUTH); textarea.append(" H H IIIIIIIII !!!!\n" + " H H I !!!!\n" + " H H I !!!!\n" + " H H I !!!!\n" + " H H I !!!!\n" + " HHHHHHHHHH I !!!!\n" + " H H I !!!!\n" + " H H I \n" + " H H I !!\n" + " H H I !!!!\n" + " H H IIIIIIIII !!\n\n\n" + "Hello and Welcome to CS380 Operating Systems\n"); } public void paint(Graphics g) { // g.drawString("Hello!", 10, 10); // add labels for textfields // ////////////////////////// } }