Check out example codes for "JFrame text java". It will help you in understanding the concepts better.

Code Example 1

label1.setText("Label Text");

Code Example 2

JLabel label1 = new JLabel("Test");
label1.setText("Label Text")

Learn ReactJs, React Native from akashmittal.com