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();