Write A Program To Demonstrate The Various Mouse Events Using MouseListener
Write A Program To Demonstrate The Various Mouse Events Using MouseListener
import java.awt.*;
import java.awt.event.*;
Label l;
Practical_11()
addMouseListener(this);
l=new Label();
l.setBounds(100,100,100,20);
add(l);
setTitle("Practical_11");
setSize(450,250);
setLayout(null);
setVisible(true);
l.setText("Mouse Clicked");
l.setText("Mouse Entered");
l.setText("Mouse Exited");
l.setText("Mouse Pressed");
l.setText("Mouse Released");
O/P :
Write a program to demonstrate the use of JTextField and JPasswordField using Listener
Inetrface.
import javax.swing.*;
import java.awt.*;
f.setTitle("Practical_12_JPasswordField");
f.setVisible(true); f.setSize(500,300);
f.setLayout(null);
pf.setEchoChar('$');
f.add(pf); f.add(jl);
O/P :
Write a program to demonstrate the use of Window Adapter Class.
import java.awt.*;
import java.awt.event.*;
{ Frame f;
Practical_13()
{ f.dispose();
});
f.setTitle("Practical_12");
f.setLayout (null);
f.setVisible (true);
O/P :
Write a program to demonstrate the use of InetAddress class and its Factory Methods.
import java.io.*;
import java.net.*;
try
catch(Exception e)
System.out.println(e);
O/P :
Write a program to demonstrate the use of InetAddress class and its Factory Methods.
import java.io.*;
import java.net.*;
try
catch(Exception e)
System.out.println(e);
O/P :