🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #20534

Re: ����һ��JTable������

#20534
From: 99SE.Eric.Hsu.��̹ܿ�
Date: Wed, 17 Dec 2003 03:10
34 lines
2007 bytes
String [] strTableHeader = {"id", "name", "date"};
String [] strPasswords = {"asdfjwe", "asdlfjqlwd", "asdjfasdf"};

Objects [][] rowData = {
        {"1", "ZhangSan", "03.11.11"},
        {"2", "LiSi", "03.11.22"}
    }

JTable myTable = new JTable(rowData, strTableHeader);

// Then, you may add mouseClicked event to the table, and handle
// it like this

void myTable_mouseClicked(MouseEvent e) {
    int _iSelectedIndex = myTable.getSelectedRow();
    String _strSelectedPassword = strPasswords[_iSelectedIndex];
}

// Hope this helps :)


�� �� trash.bbs@Freecity.dhs.org (��ǧ����) �Ĵ������ᵽ: ��
: ��Ϊżѡ��table���һ��row��Ҫ�õ����password
: �� �� happyman (������Ʒ) �Ĵ������ᵽ: ��
: : ���password��ʲôһ��Ҫ��getValueAt�õ������Լ���һ��Vector��һ�²��Ϳ�����


--
            Nothing is easy in fact
            Nothing is complicated indeed

                                    - 03.10.05.19:21.Eric
�� ��Դ:���Ұ��Ͽ�վ bbs.nankai.edu.cn��[FROM: 202.113.30.24] 
Technical Details
Message-ID: <49fj7S$A8S@bbs.nankai.edu.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newshosting.com!news-xfer2.atl.newshosting.com!167.206.3.103.MISMATCH!news3.optonline.net!ctu-peer!news.nctu.edu.tw!netnews.csie.nctu.edu.tw!maily.cic.tsinghua.edu.cn!news.happynet.org!NanKai

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f6cb0,722871aba3ac1fad,start
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2003-12-16 19:13:52 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newshosting.com!news-xfer2.atl.newshosting.com!167.206.3.103.MISMATCH!news3.optonline.net!ctu-peer!news.nctu.edu.tw!netnews.csie.nctu.edu.tw!maily.cic.tsinghua.edu.cn!news.happynet.org!NanKai
From: OtherVoices.bbs@bbs.nankai.edu.cn (99SE.Eric.Hsu.��̹ܿ�)
Newsgroups: cn.bbs.comp.lang.java
Subject: Re: ����һ��JTable������
Date: 17 Dec 2003 03:10:52 GMT
Organization: �Ұ��Ͽ�վ
Message-ID: <49fj7S$A8S@bbs.nankai.edu.cn>
X-Filename: Java/M.1071629932.A
Lines: 34