I had done a program with JFrame a year ago and I am trying to convert it to with JApplet so I can put it on the web. So far so good and I am able to see the applet and seems every functions are still working... there is one minor issue, when the below class "showTable" function is called, the applet shows blank until I resize the applet windows.. a tiny resize will fix it and everything will display. it just won't show without resizing the applet windows.
i tried to make the bound bigger but it isn't it.
i would really love to solve this bug. it is not critical but annoying.
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JApplet;
public class ShowTable implements ActionListener
{
private DataHolder dh;
private JScrollPane sPane;
private JTable sTable;
private JApplet theFrame;
public ShowTable(JApplet frame)
{
theFrame = frame;
}
public void actionPerformed(ActionEvent e)
{
codeWrapper();
}// end actionPerformed
private void codeWrapper()
{
dh = new DataHolder(true);
try
{
sTable = new JTable(dh.getRowData(), dh.getColumnNames());
sTable.setAutoCreateRowSorter(true);
sTable.setBackground(java.awt.Color.orange);
dh.shutDown();
}
catch(SQLException sqle)
{
sqle.printStackTrace();
}
sPane = new JScrollPane(sTable);
theFrame.getContentPane().removeAll();
theFrame.add(sPane, BorderLayout.CENTER);
theFrame.setBounds(0, 0, 0, 600);
theFrame.setVisible(true);
theFrame.repaint();
}
}// end class ShowTable
any suggestion would be great.. thanks