This Java source code is an example of a Graphical User Interface (GUI) with different GUI elements such as TextBox, Buttons, TextArea, Text Area and Labels. It is implemented using Java Swing API which provides a set of “lightweight” (all-Java language) components. This code example extends the functionality of JFrame class to show a JFrame window and Implements ActionListener on buttons to catch the click event on those buttons.

package com.company;

import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;

class Main extends JFrame implements ActionListener
{
    JComboBox help = new JComboBox();

    JLabel txtlabel = new JLabel("Coded by system error at weebly");

    JButton button1 = new JButton("First button");
    JButton button2 = new JButton("Second button");
    JButton button3 = new JButton("Third button");

    //text area
    JTextArea output =
            new JTextArea("output results..., " +
                    " you can also write some text in here \n "+
                    " and look at the 1337 colors", 14, 45);
    JLabel txtlabel2 = new JLabel("[email protected]");

    public Main()
    {
        super("System error's program ");
        //create window
        setSize(600, 500);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);

        //create conent container
        Container contentArea = getContentPane();
        contentArea.setBackground(Color.gray);
        //creae layout manager
        FlowLayout flowManager = new FlowLayout();
        contentArea.setLayout(flowManager);
        JComboBox help = new JComboBox();
        help.setForeground(Color.black);
        help.setBackground(Color.lightGray);

        setContentPane(contentArea);

        //combo box help
        help.addItem("Help");
        help.addItem("");
        help.addItem("This is where i'll explain");
        help.addItem("What the program is and exactly");
        help.addItem("how to use it, I haven't got");
        help.addItem("a clue what I want to do yet though.");

        contentArea.add(help);

        //text label
        txtlabel.setBackground(Color.darkGray);
        contentArea.add(txtlabel);
        setContentPane(contentArea);

        output.setForeground(Color.green);
        output.setBackground(Color.black);
        contentArea.add(output);
        setContentPane(contentArea);

        //scroll pane
        JScrollPane scroller = new JScrollPane(output,
                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        scroller.setForeground(Color.darkGray);
        contentArea.add(scroller);
        setContentPane(contentArea);

        //buttons
        button1.addActionListener(this);
        button1.setBackground(Color.lightGray);
        button1.setForeground(Color.black);
        contentArea.add(button1);
        setContentPane(contentArea);
        button2.addActionListener(this);
        button2.setBackground(Color.lightGray);
        button2.setForeground(Color.black);
        contentArea.add(button2);
        setContentPane(contentArea);
        button3.addActionListener(this);
        button3.setBackground(Color.lightGray);
        button3.setForeground(Color.black);
        contentArea.add(button3);
        setContentPane(contentArea);

        //text label
        txtlabel2.setBackground(Color.darkGray);
        contentArea.add(txtlabel2);
        setContentPane(contentArea);
    }

    public void actionPerformed (ActionEvent event)
    {
        if(event.getSource() == button1)
            output.setText("You pressed button1");
        if(event.getSource() == button2)
            output.setText("You pressed button2");
        if(event.getSource() == button3)
            output.setText("You pressed button3");
    }

    public static void main (String [] args)
    {
        Main eg = new Main();
    }
}