Tables in more attractive way

Hi guys

I have the following program please can you help me in :-

1\ colouring columns names of tables and ability of settinglines thickness that I want

of my table

2\ where the column names of the table named wabil in my application

import java.awt.Color.*;

import java.awt .*;

import javax.swing.*;

import java.util.*;

import javax.swing.JTable.*;

public class sannaa extends JFrame{

JFrame frame=new JFrame();

public sannaa() {

Container contentPane= getContentPane();

Container content = getContentPane();

String[] columnNames = {"First Name",

"Last Name",

"Sport",

"# of Years",

"Vegetarian"};

Object[][] data = {

{"Mary", "Campione",

"Snowboarding", new Integer(5), new Boolean(false)},

{"Alison", "Huml",

"Rowing", new Integer(3), new Boolean(true)},

{"Kathy", "Walrath",

"Knitting", new Integer(2), new Boolean(false)},

{"Sharon", "Zakhour",

"Speed reading", new Integer(20), new Boolean(true)},

{"Philip", "Milne",

"Pool", new Integer(10), new Boolean(false)}

};

JTable table = new JTable(data, columnNames);

setTitle("rot");

JScrollPane scrollPane = new JScrollPane(table);

getContentPane().add( scrollPane );

table.setPreferredScrollableViewportSize(new Dimension(700, 70));

String[] colum = {"First Name",

"Last Name",

"Sport",

"# of Years",

"Vegetarian"};

Object[][] rami = {

{"Mary", "Campione",

"Snowboarding", new Integer(5), new Boolean(false)},

{"Alison", "Huml",

"Rowing", new Integer(3), new Boolean(true)},

{"Kathy", "Walrath",

"Knitting", new Integer(2), new Boolean(false)},

{"Sharon", "Zakhour",

"Speed reading", new Integer(20), new Boolean(true)},

{"Philip", "Milne",

"Pool", new Integer(10), new Boolean(false)}

};

JTable wabil =new JTable(rami, colum );

JScrollPane scrolPane = new JScrollPane(wabil);

wabil.setPreferredScrollableViewportSize(new Dimension(700, 70));

getContentPane().add( scrolPane );

contentPane.setBackground( Color.white);

content.setBackground(Color.yellow);

JPanel panel=new JPanel(new BorderLayout(500,500) );

JPanel pane=new JPanel(new BorderLayout( ) );

contentPane.setLayout(new FlowLayout( ));

content.setLayout(new FlowLayout( ));

contentPane.add(panel);

content.add(pane);

JLabel hellolabel=new JLabel("Transaction");

hellolabel.setForeground(Color.black);

pane.add(hellolabel , BorderLayout.PAGE_START);

pane.setBackground(Color.blue);

panel.setBackground( Color.white );

panel.setLayout(new BorderLayout());

panel.add(table.getTableHeader( ), BorderLayout.PAGE_START);

pane.add(wabil.getTableHeader(),BorderLayout.CENTER);

setVisible(true);}

public static void main (String [] args){

sannaa van=new sannaa( );

}}

Thanks

[3077 byte] By [vanpersiea] at [2007-11-26 17:01:53]
# 1
http://www.google.com/search?q=color+java+table+background http://www.google.com/search?q=set+line+thickness+java+table
ChuckBinga at 2007-7-8 23:29:38 > top of Java-index,Desktop,Core GUI APIs...
# 2
For the second time. How to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code you post is readable.
camickra at 2007-7-8 23:29:38 > top of Java-index,Desktop,Core GUI APIs...
# 3
For the second time. How to use the Code Formatting Tags so the code you post is readable. camickr Iam sorry. but I can'tfindmany codes in the link you have putted Can you give me other link for codes
vanpersiea at 2007-7-8 23:29:38 > top of Java-index,Desktop,Core GUI APIs...
# 4
http://java.sun.com/docs/books/tutorial/uiswing/components/table.htmlI can't find many codes in the link you have puttedNot all answers lie in 'codes,' grasshopper.
itchyscratchya at 2007-7-8 23:29:38 > top of Java-index,Desktop,Core GUI APIs...