Here you can find the source of clear(JLabel... fields)
public static void clear(JLabel... fields)
//package com.java2s; //License from project: Open Source License import javax.swing.JLabel; import javax.swing.text.JTextComponent; public class Main { public static void clear(JTextComponent... fields) { for (JTextComponent field : fields) { field.setText(""); }// w w w. j a va2 s. c o m } public static void clear(JLabel... fields) { for (JLabel field : fields) { field.setText(""); } } }