Help on JTable plz....

Hello...
I am trying to make a spreadsheet in java... and i created a table using JTable... but the table has only column titles showing up... how would i have the tables row titles show up (just on the excel, which has row numbers on the left side of the screen.. 0,1,2,3,...)
Any ideas?????
Thanx

Hi,
See the JTable examples:
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
Hope it helps,
ANeto

Similar Messages

  • I selected restore factory settings on my ipod touch but now after restart it stuck on apple icon what will i do anybody help me out plz,even it's not appering on itunes on my p.c

    i selected restore factory settings on my ipod touch but now after restart it stuck on apple icon what will i do anybody help me out plz,even it's not appering on itunes on my p.c

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • FIFA 14 ULTIMATE TEAM HELP PLZ HELP ME ASKED THIS QUESTION TOO MANY TIMES BUT NO HELP ME SO PLZ HELP ME PLZ

    HI
    i like playing fifa and i wanted to start a fifa 14 ultimate team but th problem is that i know some things about fifa but not too much and i was wondering if you guys/girls can helpl me out
    you see the problem is that i dont know how to start off fifa 14 ultimate team lke what should i do when i start off and what should i should i do after
    i tried fifa ultimate team before and was no good because i always had no money left and my players were bronze and had no more contracts so can you guys/girls help m out plz
    plz help me out and reply back to me by this post plz need your help a lot plz help me plz
    thanks

    It's best to Google for answers. Here's one.
    http://www.fifauteam.com/fifa-14-mobile-ios-android/
     Cheers, Tom

  • My iphone 4 was working good until IOS6 update, now I can't hear anything, my ear phone donot response ...Speaker are ok..if some one call me...they can hear me ...but I can't hear them.....please desperately need help...plz suggest...all reset is done...

    My iphone 4 was working good until IOS6 update, now I can't hear anything, my ear phone donot response ...Speaker are ok..if some one call me...they can hear me ...but I can't hear them.....please desperately need help...plz suggest...all reset is done...except restore ...

    Anyone? . . . :S

  • Help with JTable - content of cell disappears when selected

    Hello,
    I have a jTable and I have created a custom cell renderer. It does what it's supposed to do (which is set the background color of all cells with null or "" value to red - as an indication to the user that b4 proceeding he/she has to fill in this cells). The problem is that when I select a red cell, it becomes white and the text value it contains disappears. When I double click I can start typing in a new value.
    I would appreciate any hint why this happens? Ideally I would like the cell to keep its color when clicked or double-clicked and its value, and only when i'm done editing its content and it's not null or empty string to become white.
    I'm including majority of my code (some automatically generated code from Netbeans is not included).
    Thank you very much,
    Laura
    public class DataNormalisation extends javax.swing.JFrame {   
        JTextArea txt=new JTextArea();
        public Object[][] DataSummary;
        public Vector<String> colName;
        MainF p;
        String[] ExpNames;
        /** Creates new form DataNormalisation */
        public DataNormalisation(String[] EN, MainF parent) {
            p=parent;
            ExpNames=EN;
            colName= new Vector<String>();
            colName.add("Sample Name");
            colName.add("Replicate Group");
            DataSummary=new Object[ExpNames.length][2];
            for (int i=0;i<ExpNames.length;i++){
                DataSummary[0]=ExpNames[i];
    initComponents();
    this.jTable1.getTableHeader().setReorderingAllowed(false);
    TableColumn column = jTable1.getColumnModel().getColumn(1);
    column.setCellRenderer(new CustomTableCellRenderer());
    private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new JTable (new DataModel());
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Data Normalisation");
    jTable1.setAutoCreateRowSorter(true);
    jTable1.setCellSelectionEnabled(true);
    jScrollPane1.setViewportView(jTable1);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration
    class DataModel extends AbstractTableModel {       
    class TML implements TableModelListener{
    public void tableChanged (TableModelEvent e){
    txt.setText(""); // Clear it
    for (int i=0;i<DataSummary.length; i++){
    for (int j=0; j<DataSummary[0].length;j++){
    txt.append(DataSummary[i][j] + " ");
    txt.append("\n");
    public DataModel(){
    addTableModelListener(new TML());
    @Override
    public void setValueAt(Object val, int row, int col){
    DataSummary[row][col]=val;
    fireTableDataChanged();
    @Override
    public boolean isCellEditable(int row, int col){
    return (col != 0);
    public int getRowCount(){
    return DataSummary.length;
    public int getColumnCount(){
    return colName.size();
    public Object getValueAt(int row, int column){   
    return DataSummary[row][column];
    public String getColumnName(int col) {           
    return colName.get(col);
    class CustomTableCellRenderer extends DefaultTableCellRenderer {       
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {
    Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    if (value == null || value.equals("")) {
    cell.setBackground(Color.red);
    } else cell.setBackground(Color.white);
    return cell;

    Ideally I would like the cell to keep its color when clicked or double-clicked Not sure why is changes color when you click on the cell.
    But when you double click the editor is invoked, which is a JTextField and its background is white by default.
    The code you posted doesn't help because its not executable.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    And don't post NetBeans generated code, because we don't use IDE to write GUI code.
    Also, why did you create a custom TableModel. The DefaultTableModel will store your data for you.

  • Jaxrpc compilation exception(plz Help very Urgent Plz)

    Hello there....
    while deploying a simple webservice using deploytool i m getting this error while the application that is being deployed is not even using ejbs....
    i m trying to compile the example given on the forum by Qusay H. Mahmoud, so plz help me to get out from this......
    Thank u ....alll
    distribute: C:\Sun\AppServer\apps\Add.war
    deployment started : 0%
    Deploying application in domain failed; Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception
    ; requested operation cannot be completed
    !!! Operation Failed !!!
    !!! With The Following Failure Messages !!!
    Deploying application in domain failed; Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception
    ; requested operation cannot be completed
    Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception
    [Completed (time=24.0sec, status=13)]
    **********************************************************************

    I had a similar problem with Sun App Server.If you can check the domain/log/Server.log.It explains a valid endpoint address is missing in the deployment.To do this open the deployment tool and click the Implementation class in the tree(Bean Shaped).
    You can see a endpoint tab within which you need to configure the Endpoint address.
    The deployment went fine after this.
    Good Luck !!!

  • Please help about JTable...thanks

    HI everyone!
    Please tell me how to write a ACTIONLISTENER for a JTABLE?
    JTABLE table;
    Object[][] myArray = {  {"Mary", new Integer(5)},
    {"Alison", new Integer(3)},
    {"Angela", new Integer(1)}
    String[] columnNames = {"First Name", "Scores"};
    table = new JTable(myArray, columnNames);
    how do you write a actionlistener for a JTable?
    thanks

    One of the things I'd recommend is reading the tutorial on "How to use Tables" at the Sun website. Unless you have a button or something like that on the container the JTable is in, I don't think you want an ActionListener. One of the things you can do is set up a ListSelectionListener. It allows you to do something when a value changes in the ListSelectionModel. When you select rows in a JTable, a ListSelectionModel is created. Retrieve the ListSelectionModel from your JTable, and add a listener to it, something like:
    JTable runTable = new JTable(yourTableModel);
    runTable.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); // set mode
    //or use default
    ListSelectionModel rowSM = runTable.getSelectionModel();
    rowSM.addListSelectionListener(new TimeSelectionListener());
    class TimeSelectionListener implements ListSelectionListener {
    public void valueChanged(ListSelectionEvent e) {
    //Ignore extra messages.
    if (e.getValueIsAdjusting()) return;
    ListSelectionModel lsm = (ListSelectionModel)e.getSource();
    if (lsm.isSelectionEmpty()) {
    // ...//no rows are selected
    } else {
    ... // If some rows are selected, do something here!!!
    I hope this helps.

  • Help updating jTable (model?)

    I've got a jTable, which stores information that I retrieve from game servers (player's name, frag count, and time connected to the server). I'll admit first off that I'm very, very new to Swing and still new to Java as a whole. I've searched the forums several times (which is the only reason I got as far as I have) and I've also closely examined the tutorial, API, and examples. I probably have already looked at my answer, but it eludes me. My table doesn't seem to be updating its display or I'm not properly modifying the object's contents because my table will only display empty cells (although the correct number of rows). Here's some snippets of what I've got so far:
    Object[][] data;
    String[] columnNames = {"Name", "Frags", "Time"};
    final DefaultTableModel model;
    data = new Object[64][3];       
    model = new DefaultTableModel(data, columnNames);
    model.setRowCount(0);
    playersListTable = new javax.swing.JTable();
    playersListTable.setModel( model );
    public void updatePlayerInfo() {
            int x = 0;
            if (settings.getServerProp("PlayerInfoNum") != null) {
                model.setRowCount(Integer.valueOf(settings.getServerProp("PlayerInfoNum")));
                while (Integer.valueOf(settings.getServerProp("PlayerInfoNum")) > x) {
                    System.out.println("Updating player info... " + x);
                    data[x][0] = settings.getServerProp("PlayerName" + x);
                    data[x][1] = settings.getServerProp("PlayerScore" + x);
                    data[x][2] = settings.getServerProp("PlayerTime" + x++);
                model.fireTableDataChanged();
        }I'm about to head off to work, so my apologies if I left out important details. I'll be around later to fill in any gaps I mistakenly forgot. Thanks again for the help!
    EDIT: The table gets updated on one second intervals.
    Edited by: mr0ldie on Nov 16, 2008 1:31 PM

    Thank you very much! :) I was very confused on how tables worked--I thought I still had to manage the data myself and the table and model were simply containers and visible settings for that (probably not explaining how I thought of it well, but I didn't fully understand, so explaining is even harder ;). Anyway, I've got it working, thanks to your help!

  • Help with JTables

    Hi i have a form with a combo box and a jtable
    Each item in the combo box is associated with a set of values with need to be displayed in the row/column format using the JTable.So for each value selected in the combo box the contents of the table should change.Could anyone help me out with this.Thanks
    Krishna

    what do you have so far?

  • HElp required..plz...plz.help..fast

    hi frndz,
    i neeed ur help...i hav sum doubts ..plz answer.i hav nokia 3250 fone..
    1. u kno ders 1 hole wer we incert chargerwire 2 recharge batreee....the pin in dat hole is broken...ma doubtis dat whether it can b repared..?..is it so costly 2 reapir?..is it a risky damage?..
    2.i hav downloaded many songs..but most of dem windows meadi audio....i hav onli real palye rinma mobile..so onli rm,mp3,mp4 audio formats r working...if u hav ny idea..abt it.plz say..and plz give me da link 2 dload ny player 4 mobile which can play all audio formats..
    3.im not able 2 send text messages..itznot d aprblm wid credit or ny thing...wenever i write messages 2 ne1..it wil say sending failled...can ya tel me sum solution..
    SO THESE R MA DOUBTS....I HOPE I WIL GET A SUITABLE ANSWER 4 MA QUESTION...MAY GOD BLESS YA........

    let me try, CMIIW..
    hi friends,
    i need your help.. i have some doubts..please answer, i have nokia 3250 phone..
    1. you know theres 1 hole where we insert chargerwire to recharge battery....the pin in that hole is broken...my doubt is that whether it can be repaired?..is it so costly to repair(expensive)?..is it a risky damage?..
    2.i have downloaded many songs..
    but most of them windows media audio....
    i have only real player in my mobile..
    so only rm,mp3,mp4 aodio formats are working ..
    if u have any idea about it please say..
    and please gime me the link to download nyew player for my mobile which can play all audio formats..
    3.im not able to send text messages..its not the problem with credit or anything...whenever i write messages to new one.. it will say sending failed.. can you tell me some solution?
    ===============================
    1.expensive is relative. for you might be cheap rather than me. and depends on nokia care.
    2.i havent try others player
    3.please check message number on your mobile phone
    cheers...
    n gage classic , waitin for n gage3 (will there?)

  • Help a newbie plz

    Can u help answer a few questions plz. Which adobe flash player do u download on the IPhone? Gives me 2 options...option 1 Intel-based macs or Option 2 PowerPC-based Macs. And how can I sent multi messages. Or u can only send one at a time? Why do I get viewmymessage instead of the picture itself? Do I need to request ATT for that option? Sorry for asking a lot. Please help Thanks

    current work around for sending MMS's
    All you do is type in the phone number + the cell company that that person uses doamin address (Example for Tmobile: [email protected]) I went in and added the addresses of the pepole I would most likely send a MMS to to my address book. Yeah you ahve to take the time to figure out what cell company they are using but after the initial setup you are ready to go from then on. here is a list of all the cell companys tags.
    Alltel = [email protected]
    AT&T = [email protected]
    Boost Mobile = [email protected]
    Cingular (AT&T) = [email protected]
    Einstein PCS = [email protected]
    Sprint = [email protected]
    T-Mobile = [email protected]
    US Cellular = [email protected]
    Verizon Wireless = [email protected]
    Virgin Mobile = [email protected]
    *x is the digit of the phone number you send it to
    not the answer you want but I hope this helps

  • Help me overclock plz

    sup guys...
    can u guys gimme some tips to overclock my cpu...i have an amd 2100+...i wanna get the best out of my computer...can u plz help

    Just a little confused, you say you have 2100+ but you equipment list shows a 3000+ cpu.  The are several programs you can use to help set up you BIOS to oc the cpu and fsb. You can do it manually with the mobo you have and you can start by setting the fsb to 175 and multiplier to 10.  These are low numbers but they are good starts.  Then if you want to go higher on the fsb, increase it by 5 but watch your temps on the cpu in PC Health of Bios.  At some point the unit will not boot up if you go to far.  Then you will have to reset your CMOS.
    The easiest thing to due is download FuzzyLogic 4 or Core Center and let them get you into a starting range.

  • Help with chat plz

    Hi im really new to java so this question must be kinda easy so plz help
    Im able to connect several clients with threads to a central server but how am i able to send the msgs to all the clients connected?
    Some simple code would be really apreciated.
    thx a lot.

    A Solution can be like this.
    make a static object of class vector in your main server class.
    static vector connections=null;
    If you are unaware of Vector class,refer any JAVA book.
    you may initialise it in your constructor.
    Now whenever your client connects, the thread which will be responsible for handling the connections, adds to the vector object connections. As the object connections is static, you would be able to directly call it and add the hostname of the client which just got connected. It should be something like this....
    mainclass.connections.AddItem( " Hostname" );
    I forgot the vector class methods for adding up items....try refering the same in a book.
    This way you will be able to maintain a list of clients connected on your server.
    Hope this resolves ur problem ..
    Regards
    Arvind

  • Help with McAfee plz

    Hi to all Im new to this site/forum and would like some help plz
    Just installed Mcafee from BT and I was wondering if anyone else is using it ?
    my question is Im trying to find in the settings where you can exclude files/folders/ drives(external) from being scanned  but I cant find it any where in any of the settings
    ca anyone help plz
    n
    thanks in advance

    Click on the shield bottom right of screen:
    Select Virus and spyware protection
    Select Scan your PC
    Select Run a custom scan
    Then there are a number of options for you to chooses what to scan.
    However I would get a different anti virus software as the one thing I do not like about this is that it has a mind of its own when it comes to updates and will update when it wants to which slows the PC down and whatever you do you can not stop the update. This is very annoying if you are trying to do something which is time dependent.

  • Need help about JTable

    Can some one please help me about how to sort a column in a JTable when click on the the column title

    Can't tell you off the top of my head but I know you will find it here...
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#selection

Maybe you are looking for

  • Upload XL file from FTP server

    Hi All, Can anybady help me, how to upload Excel file from FTP server. Thanks Sri Edited by: srikanthn on Apr 14, 2010 6:31 PM

  • Viewing gallery on older Mac

    My brother and sister-in-law have an older iMac, probably running an earlier version of OS X and iPhoto. We published a web gallery of some of our photos, but they were having trouble accessing it. Are there system requirements for viewing the photo

  • Error in SXMB_MONI -"HTTP_RESP_STATUS_CODE_NOT_OK

    Hi all, In a file to file to scenario, i'm getting this error in SXMB_MONI Error - " HTTP_RESP_STATUS_CODE_NOT_OK"             503             Service Unavailable Please provide me the exact solution Thanks, Younus

  • How to change UTF-8 encoding for XML parser (PL/SQL) ?

    Hello, I'm trying to parse xml file stored in CLOB. p := xmlparser.newParser; xmlparser.parseCLOB(p, CLOB_xmlBody); Standard PL/SQL parser encoding is UTF-8. But my xml CLOB contain ISO-8859-2 characters. Can you advise me, please, how to change enco

  • Watching stars on demand and a 3d movie

    I watched both iron man 3 and plans using starz on demand and my tv is turned on with the 3d settings but when watching the movies the screen cuts in half either you can pick horizontal pictures of the same movie or vertical how do I get the 3D movie