Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem with the following program...pls help...

Reply
Thread Tools

Problem with the following program...pls help...

 
 
vivekdarshan vivekdarshan is offline
Junior Member
Join Date: Oct 2010
Posts: 1
 
      10-17-2010
import java.awt.event.*;
import javax.swing.*;

public class JTableExample extends JFrame{

String data[][]={{"John","Sunderland","Student"},
{"George","Davies","Student"},
{"Melissa","Anderson","Associate"},
{"Stergios","Maglaras","Developer"},
};

String fields[]={"Name","Surname","Status"};

public static void main(String[] argv) {
JTableExample myExample = new JTableExample("JTable Example");
}

public JTableExample(String title){
super(title);
setSize(150,150);
addWindowListener(new WindowAdaptor(){
public void windowClosing( WindowEvent we) {
dispose();
System.exit(0);
}});
init();
pack();
setVisible(true);
}

private void init() {
JTable jt = new JTable( data, fields );
JScrollPane pane = new JScrollPane(jt);
getContentPane().add(pane);
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
RE: The Web server reported the following error when attempting to create or open the Web project located at the following URL: <URL> =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:36 AM
Problem burning CD-RW : nero sends "error following track" Thierry Computer Support 3 01-05-2004 06:00 PM
Following Up: Unusual Solution To Vid Capture Problem Pete Holland Jr. Computer Support 2 12-31-2003 05:59 AM
Problem with following message NYangel Computer Support 2 09-13-2003 03:32 PM



Advertisments