import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.*;
public class CE203_2019_Ass1 implements ActionListener {
public static JButton addButton;
public static JButton displayButton;
public static JButton removeButton;
public static JButton clearButton;
public static JLabel label, textlabel, RGBlabel;
public static JTextField textInput, R, G, B;
public static Operations operate;
public CE203_2019_Ass1(){
operate = new Operations();
}
public JPanel createTopPanel() {
//adding button on the top
JPanel topPanel = new JPanel();
addButton = new JButton("Add Word");
addButton.addActionListener(this);
topPanel.add(addButton);
displayButton = new JButton("Display Words");
displayButton.addActionListener(this);
topPanel.add(displayButton);
removeButton = new JButton("Remove Word");
removeButton.addActionListener(this);
topPanel.add(removeButton);
clearButton = new JButton("Clear List");
clearButton.addActionListener(this);
topPanel.add(clearButton);
topPanel.setSize(500, 100);
topPanel.setLocation(0, 0);
return topPanel;
}
public static JPanel createMiddlePanel() {
JPanel panel = new JPanel();
label = new JLabel("LABEL");
//textlabel = new JLabel("Text Input");
panel.add(label);
panel.setSize(500, 200);
panel.setLocation(0, 150);
return panel;
}
public static JPanel createBottomPanel() {
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.*;
public class CE203_2019_Ass1 implements ActionListener {
public static JButton addButton;
public static JButton displayButton;
public static JButton removeButton;
public static JButton clearButton;
public static JLabel label, textlabel, RGBlabel;
public static JTextField textInput, R, G, B;
public static Operations operate;
public CE203_2019_Ass1(){
operate = new Operations();
}
public JPanel createTopPanel() {
//adding button on the top
JPanel topPanel = new JPanel();
addButton = new JButton("Add Word");
addButton.addActionListener(this);
topPanel.add(addButton);
displayButton = new JButton("Display Words");
displayButton.addActionListener(this);
topPanel.add(displayButton);
removeButton = new JButton("Remove Word");
removeButton.addActionListener(this);
topPanel.add(removeButton);
clearButton = new JButton("Clear List");
clearButton.addActionListener(this);
topPanel.add(clearButton);
topPanel.setSize(500, 100);
topPanel.setLocation(0, 0);
return topPanel;
}
public static JPanel createMiddlePanel() {
JPanel panel = new JPanel();
label = new JLabel("LABEL");
//textlabel = new JLabel("Text Input");
panel.add(label);
panel.setSize(500, 200);
panel.setLocation(0, 150);
return panel;
}
public static JPanel createBottomPanel() {