You should set values by using set components (properties) to the object than initializing values directly through the constructor.
Eg -
JLabel mylbl = new JLabel("myName");
You should better to practice to use above syntax as follow
setText(String text) Defines the single line of text this component will display.
JLabel mylbl = new JLabel();
mylbl.setText("myName");
For the More info, refer this