Hello, I want to add a table to button MouseListener does not work because i cant call class. Any ideas what should i do ?
Table:
public static void Table(){
JTable jt;
String[]columns = {"Kind","Weight","Location","Date","Bait"};
String[][]data = {{"Carp","2kg","Levkuška","29.5.2013","HotDeamon"} ,{"Carp","3kg","Levkuška","29.5.2013","HotDeamon"} ,{"Carp","4kg","Levkuška","29.5.2013","HotDeamon"} };
jt= new JTable(data,columns);
jt.setPreferredScrollableViewportSize(new Dimension(640,100));
jt.setFillsViewportHeight(true);
JScrollPane jsp = new JScrollPane();
add(jsp);
}
MouseListener:
package fishman.denileet;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JButton;
public class CustomTable implements MouseListener {
private JButton button1;
public CustomTable(JButton button1) {
this.button1= button1;
}