Click to See Complete Forum and Search --> : JTable Problem, No values are shown
September 29th, 1999, 07:57 AM
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.
meherss
September 30th, 1999, 01:50 PM
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
October 1st, 1999, 01:32 AM
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);
}
}
meherss
October 1st, 1999, 10:56 AM
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
October 4th, 1999, 08:39 AM
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
meherss
October 4th, 1999, 01:56 PM
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
October 5th, 1999, 01:33 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.