CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Guest

    JTable Problem, No values are shown

    I have a JTable applet with 50'000 lines. If I run the applet with the Netscape, everything seems to be ok. If I run the applet with the InternetExplorer it doesn't work. The applet is running the scrollbars works but no values are shown.


  2. #2
    Join Date
    Jun 1999
    Location
    Atlanta, GA
    Posts
    57

    Re: JTable Problem, No values are shown

    If the table data is available when you create the model - then it should show.
    If the data is added after you have created the table model then you have to trigger the change
    by doing tableModel.fireTableDataChanged();
    then, you will see the values in side the table.

    hope this helps, if not be more specific about your problem or put the sample code...

    Meher

  3. #3
    Guest

    Re: JTable Problem, No values are shown

    Here is the sample code:

    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JTable;
    import javax.swing.JScrollPane;

    public class TableDemoApplet extends JApplet {

    JTable table = new JTable(100000,6);

    public void init() {

    for(int i=0; i<100000; i++) {
    table.setValueAt(new Integer(i), i, 0);
    table.setValueAt("Hello", i, 1);
    table.setValueAt("Hello", i, 2);
    table.setValueAt("Hello", i, 3);
    table.setValueAt("Hello", i, 4);
    table.setValueAt("Hello", i, 5);
    }

    JScrollPane scrollPane = new JScrollPane(table);

    setContentPane(scrollPane);


    }

    }




  4. #4
    Join Date
    Jun 1999
    Location
    Atlanta, GA
    Posts
    57

    Re: JTable Problem, No values are shown

    See the following code - tested and it's working.


    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JTable;
    import javax.swing.JScrollPane;

    public class TableApplet extends JApplet
    {
    JTable table = new JTable(100000,6);

    public void init()
    {
    for(int i=0; i<100000; i++)
    {
    table.setValueAt(new Integer(i), i, 0);
    table.setValueAt("Hello", i, 1);
    table.setValueAt("Hello", i, 2);
    table.setValueAt("Hello", i, 3);
    table.setValueAt("Hello", i, 4);
    table.setValueAt("Hello", i, 5);
    }

    JScrollPane scrollPane = new JScrollPane(table);
    setContentPane(scrollPane);
    table.invalidate();
    table.repaint();
    }
    }




    Give me a shout if you could not.

    Meher

  5. #5
    Guest

    Re: JTable Problem, No values are shown

    There is the same Problem. It works with Netscape but not with the IExploerer.

    It works with Windows NT also in the Internet Explorer. But why it doesn't work with Win95?
    I use the JDK Version 1.1.7B

    Peter




  6. #6
    Join Date
    Jun 1999
    Location
    Atlanta, GA
    Posts
    57

    Re: JTable Problem, No values are shown

    As i know if you are installing the same IE on NT and 95 there should not be any problem. If you have a older version of IE than you have to use the Sun's convertor to have the plugin used for your Swing classes.

    Q: When you run the applet on 95, does the applet started successfully ?
    Means, when you place your cursor on top of the applet does it says "Applet started" on status bar or any error... this might give you some clue
    why it is not started other wise look at your java console for any exceptions....


    Meher

  7. #7
    Guest

    Re: JTable Problem, No values are shown

    I use the same Version from the IE on NT and 95.

    The applet starts successfully. The scrollbars works but you can't see any values. If I reduce the number of rows to 5000. It works also with 95.

    Peter


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured