Here you can find the source of setResultRecordCountColour(JLabel label, boolean limitSet, Integer limitRecords, Integer ActualRecords)
public static void setResultRecordCountColour(JLabel label, boolean limitSet, Integer limitRecords, Integer ActualRecords)
//package com.java2s; /**//w ww . j a v a 2s . com * @author David Garratt * * Project Name : Commander4j * * Filename : JUtility.java * * Package Name : com.commander4j.util * * License : GNU General Public License * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * http://www.commander4j.com/website/license.html. * */ import java.awt.Color; import javax.swing.JLabel; public class Main { public static void setResultRecordCountColour(JLabel label, boolean limitSet, Integer limitRecords, Integer ActualRecords) { String warning = ""; if (ActualRecords > 0) { if (limitSet) { if (ActualRecords >= limitRecords) { label.setForeground(Color.RED); warning = " Number of records returned constrained by user defined limit."; } else { label.setForeground(Color.BLACK); } } else { label.setForeground(Color.BLACK); } label.setText(String.valueOf(ActualRecords) + " record(s) retrieved." + warning); } else { label.setForeground(Color.BLACK); label.setText("0 records shown."); } } }