Article View: borland.public.jbuilder.java.language
Article #15628Re: JTable help???
From: Tod Cunningham
Date: Tue, 18 May 1999 00:00
Date: Tue, 18 May 1999 00:00
56 lines
2338 bytes
2338 bytes
The column headers will only show up if the JTable is contained within a
scroll list.
Abhijit wrote:
> I am creating a simple JTable. The data shows up, but the column header
> (with the column names)
> does not show up. Any suggestions???
>
> CODE
> //------------------------------------------
> public class Frame1 extends DecoratedFrame
> {
> /***************************************************
> ****************************************************/
> //Construct the frame
> XYLayout xYLayout1 = new XYLayout();
>
> String[][] data = {{"1","2","3"},{"4","5","6"}};
> String[] Header = {"A","B","C"};
>
> JTable jTable1 = new JTable(data,Header);
>
> /***************************************************
> ****************************************************/
> public Frame1()
> {
> try{
> jbInit();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> }
> /***************************************************
> //Component initialization
> ****************************************************/
> private void jbInit() throws Exception
> {
> this.setLayout(xYLayout1);
> this.setSize(new Dimension(400, 300));
> this.setTitle("Frame Title");
> this.add(jTable1, new XYConstraints(37, 32, 314, 197));
> }
> /***************************************************
> ****************************************************/
> public static void main(String[] args)
> {
> Frame1 frame11 = new Frame1();
> frame11.show(true);
> }
> /***************************************************
> ****************************************************/
> }
Technical Details
Message-ID:
<3741C409.1FB4A1EF@zenith.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<373EE60F.5AB37F0C@thecia.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,bc4d00e96403c103 X-Google-Attributes: gidf74b3,public From: Tod Cunningham <tod.cunningham@zenith.com> Subject: Re: JTable help??? Date: 1999/05/18 Message-ID: <3741C409.1FB4A1EF@zenith.com> X-Deja-AN: 478841527 Content-Transfer-Encoding: 7bit References: <373EE60F.5AB37F0C@thecia.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: http://extra.newsguy.com Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language