mercredi 15 avril 2020

How do you put a conditional if that pops a dialog based on jTable object?

I am having trouble in java swing as I do not know how to make a conditional if that would pop up a jDialog based on the amount of object/rows in the jTable. How do you do that?

I have a dialog I want to pop out that shows an error message if there are no objects in the table and if there are then it would pop up another dialog that would allow the user to continue to the system process.

I don't know if it will help you guys understand my question more but here's my code:

private void billMousePressed(java.awt.event.MouseEvent evt) {
errorDialog.setVisible(true);

I want to put errorDialog.setVisible(true) inside a conditional if. It should only be visible if there are rows/objects inside the table model or objects < 1 but I don't know how to do it.

P.S Sorry if this is a dumb question, I am a complete newbie.

Aucun commentaire:

Enregistrer un commentaire