0% found this document useful (0 votes)
7 views2 pages

11 Ajp

ENVIRONMENT

Uploaded by

vedant bhele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

11 Ajp

ENVIRONMENT

Uploaded by

vedant bhele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Name : VEDANT DEEPAK BHELE

Roll no : 03

Class: TYCOB

Practical no : 11

package pr11;
import java.awt.*;
import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
public class pr_11 implements MouseListener
{
int count=0;
JLabel l1;
public void myFrame()
{
JFrame f1=new JFrame("Mouse listener Interface");
f1.setVisible(true);
f1.setBounds(100,100,800,700);
f1.setLayout(null);
f1.addMouseListener(this);

l1 = new JLabel("User clicks 0 times");


l1.setBounds(100,100,200,40);
f1.add(l1);
}
public static void main(String[] args)
{
pr_11 obj=new pr_11();
obj.myFrame();
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
count=count+1;
l1.setText("User clicks " + count + " times");

@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}

@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub

@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub

@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub

}
}

You might also like