How to delete records from jtabel

How to delete records from jtabel

View Answers

May 2, 2008 at 6:46 PM

Hi

i am sending code according to your requirement,

import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import javax.swing.table.DefaultTableModel;

public class DeleteRows{
public static void main(String[] args) {
new DeleteRows();
}
public DeleteRows(){
DefaultTableModel model;
JFrame frame = new JFrame("Delete rows in the table!");
JPanel panel = new JPanel();
String data[][] = {{"1","10-04-2008","3:42:00"},{"2","11-04-2008","4:00:00"},{"3","12-04-2008","5:54:00"},
{"4","13-04-2008","3:42:00"},{"5","14-04-2008","3:42:00"}};
String col[] = {"S.No","Date","Time"};
model = new DefaultTableModel(data,col);
JTable table = new JTable(model);
JTableHeader header = table.getTableHeader();
header.setBackground(Color.pink);
JScrollPane pane = new JScrollPane(table);
panel.add(pane);
frame.add(panel);
frame.setUndecorated(true);
frame.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
System.out.println("Befoure removing, number of rows: "+ model.getRowCount());
//Remove last row
model.removeRow(4);
System.out.println("After removing last row, number of rows: " + model.getRowCount());
frame.setSize(500,200);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}


------------------------------

read for more information,

http://www.roseindia.net/java/example/java/swing/









Related Tutorials/Questions & Answers:
How to delete records from jtabel - Swing AWT
How to delete records from jtabel  hello I am using jtabel.... It is working properly.but now i want to delete rows from tabel at a time one row... number). also tell me ho to genrate serial number for file records.  Hi
Delete a Records in Database
to delete the records or rows from a table followed by where clause... Delete a Records in Database       The Delete Statement is used to delete the records and rows
Advertisements
how to display records from database
how to display records from database  I want to display records from database in tables, the database is having 2000 records and i want to display 20 records at a time and to use next and previous link buttons to show
How to delete excel file records using Store Procedure?
How to delete excel file records using Store Procedure?  Hi.. I have created one Excel file through stored procedure.Now I want to delete records or delete excel file. Thanks
How to delete data from MySQL?
How to delete data from MySQL?  Hi, How I can conditionally delete... to conditionally delete the data from MySQL database table. Here is some query examples: delete from email where email_count=400; delete from email where
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
how to delete a jar from mobile
how to delete a jar from mobile  After auto updating a new version of jar from server. I want to delete the old jar from mobile and want to install the new jar which is present in server. Can u tell me the code how to do
How to insert or delete records in MS access database using jsp - JSP-Servlet
How to insert or delete records in MS access database using jsp  Hi friends please provide me a solution that i insert or delete record from a database using java server pages. I used the microsoft access 2003 database. PlZ
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks
how to delete a jar from mobile in j2me application
how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile... the code how to do that in my application in j2me for lwuit applications. Thanks

Ads