java - Removing displayed data from JTable -


This is the 'new' button in my login form; Additionally, I want to remove all the displayed data. How can I do this?

  saved = false; txt_ipath.setText (zero); txt_md_by_p.setText (zero); txt_model_p.setText (zero); txt_p_date.setText (sdf.format (date)); txt_p_price.setText (zero); txt_p_qty.setText (zero); txt_s_price_p.setText (zero); Txt_vouchdate_p.setText (sdf.format (date)); txt_vouchno_p.setText (zero);  

Assuming that you are using a DefaultTableModel for your JTable You can use:

  models. Settrov calculation (0);   

Or, if you are extracting a line of data then you can use it:

  model.removeRow (...);   

Any changes to the data should be made through the model.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -