package eas.startSetup.tableExamples;
import java.awt.Window;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JTable;
public class MouseHoverTable extends JFrame {
private static final long serialVersionUID = 1L;
static int itsRow = 0;
static int itsColumn = 0;
JTable itsTable;
MouseHoverTable(String framename) {
super(framename);
itsTable = new JTable(5, 3);
// make the table transparent
itsTable.setOpaque(false);
itsTable.setDefaultRenderer(Object.class, new AttributiveCellRenderer());
MyMouseAdapter aMouseAda = new MyMouseAdapter();
itsTable.addMouseMotionListener(aMouseAda);
this.getContentPane().add(itsTable);// jsp);
}
@SuppressWarnings("deprecation")
public static void main(String[] args) {
JFrame frame = new MouseHoverTable("Table Example");
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
Window w = e.getWindow();
w.setVisible(false);
w.dispose();
System.exit(0);
}
});
frame.pack();
frame.show();
}
}