Check out example codes for "how to create a java jframe". It will help you in understanding the concepts better.

Code Example 1

JFrame frame = new JFrame("Test Frame");
 frame.setSize(500,400);
 frame.setVisible(true);
 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Learn ReactJs, React Native from akashmittal.com