C:\Documents and Settings\Kruno\Desktop\event\eve.java:14: addMouseListener(java.awt.event.MouseListener) in java.awt.Component cannot be applied to (myprojects.event.eve)
btn.addMouseListener(this);
btn.addMouseListener(this);
Code:
package myprojects.event;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
public class eve extends JFrame
{
public eve()
{
JTextArea txt = new JTextArea(10,10);
JButton btn = new JButton("sadsad");
btn.addMouseListener(this);
JList lst = new JList();
/////////////
String listed[] = new String[10];
for(int i=0; i < 10; i++)
listed[i] = 11111*1;
/////////////
lst.setListData(listed);
//////////////
txt.setBorder(BorderFactory.createBevelBorder(1));
lst.setBorder(BorderFactory.createEtchedBorder(1));
//////////////
///////////////
Container cont = getContentPane();
JPanel pane = new JPanel();
//pane.setLayout(new GridLayout(0,1));
pane.add(btn);
pane.add(txt);
pane.add(lst);
cont.add(pane);
}
public void mouseClicked(MouseEvent event)
{
}
public static void main(String args[])
{
eve frame = new eve();
frame.setTitle("u suck");
frame.setVisible(true);
frame.validate();
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}