0% found this document useful (0 votes)
17 views2 pages

Java Swing GUI Example with Buttons

Communication
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Java Swing GUI Example with Buttons

Communication
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import [Link].

FlowLayout;

import [Link];

import [Link];

import [Link];

import [Link];

import [Link];

class GUI implements ActionListener

JFrame frame;

JTextField text1, text2;

JButton clear, swipe;

String str1, str2;

public GUI()

frame = new JFrame("EXAMPLE");

text1 = new JTextField(10);

text2 = new JTextField(10);

clear = new JButton("Clear");

swipe = new JButton("Swipe");

[Link](new FlowLayout());

[Link](300,400);

[Link](true);

[Link](text1);

[Link](text2);

[Link](clear);

[Link](swipe);

[Link](JFrame.EXIT_ON_CLOSE);

[Link](this);
[Link](this);

public void actionPerformed(ActionEvent e)

str1 = [Link]();

str2 = [Link]();

if([Link]()==clear)

[Link](" ");

[Link](" ");

if([Link]()== swipe)

[Link](str2);

[Link](str1);

public class Test {

public static void main(String[] args)

GUI g = new GUI();

You might also like