Here you can find the source of buildLabel(JFrame frame, String txt, int x, int y, int w, int h)
private static JLabel buildLabel(JFrame frame, String txt, int x, int y, int w, int h)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JLabel; public class Main { private static JLabel buildLabel(JFrame frame, String txt, int x, int y, int w, int h) { //JLabel JLabel lbl = new JLabel(); lbl.setText(txt);// w w w .j a v a 2 s . com lbl.setBounds(x, y, w, h); lbl.setForeground(Color.yellow); lbl.setFont(new Font("Canadra", Font.BOLD, 22)); frame.add(lbl); return lbl; } }