panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
panel.setBorder(BorderFactory.createEtchedBorder());
// A checkbox to determine whether to display all the data in the table.
JCheckBox allDataCheckBox = new JCheckBox("Show all data?");
allDataCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JCheckBox checkBox = (JCheckBox) e.getSource();
if (checkBox.isSelected()) {
// Show all data, no filtering, no search permitted.