How to show details of the entire database in one text field

This is my code, but I don’t understand how to put the results of the entire search in one text field.

private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) 
{                                          
    String SearchProduct ;  
    DBConnector dbcon = new DBConnector();//connecting to DB
    dbcon.connect();//code for sql to select all from the table
    if (dbcon.isProductExists) {
        msg.showMessageDialog(this,"Search Successful","Search Status",1);
        txtSearchResults.setText()
    }
    else  {
        msg.showMessageDialog(this,"no results found","Search Status",1);
    }
}

Is it possible? if this is not possible, can you suggest anything else?

+4
source share

Source: https://habr.com/ru/post/1606113/


All Articles