JFrame text java

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

Also in Java: