/*==============================================================================
* Author : Karthikeyan A - MaargaSystems pvt.;td
* Created : 04-May-2009
* Purpose : illustrate the usage of on FoucsListener Class by Capturing on exit event of a TextField/JTextField
*==============================================================================
*/
import java.awt.BorderLayout;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.Frame;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
//import javax.swing.*;
//import java.awt.*;
//import java.awt.event.*;
public class TextFieldTask {
public void onExit_TextField(TextField tf) {
tf.addFocusListener(new FocusListener(){
public void focusGained(FocusEvent arg0) {
System.out.println("gained focus");
}
public void focusLost(FocusEvent arg0) {
System.out.println("lost focus");
msgbox("lost focus","captured on exit");
}
});
}
void msgbox(String message,String title) {
Object[] options = {"Ok"};
javax.swing.JFrame frame=new javax.swing.JFrame();
int n = javax.swing.JOptionPane.showOptionDialog(frame,
message,
title,
javax.swing.JOptionPane.OK_OPTION,
0,
null,
options,
options[0]);
}
public static void main(String args[]){
final TextFieldTask tft=new TextFieldTask();
//JPanel jp=new JPanel();
//JTextField tf1=new JTextField();
//JTextField tf2=new JTextField();
Panel p=new Panel();
TextField tf1=new TextField();
TextField tf2=new TextField();
tft.onExit_TextField(tf1);
//jp.setLayout(new BorderLayout());
//jp.add(tf1,BorderLayout.NORTH);
//jp.add(tf2,BorderLayout.SOUTH);
p.setLayout(new BorderLayout());
p.add(tf1,BorderLayout.NORTH);
p.add(tf2,BorderLayout.SOUTH);
//JFrame jf= new JFrame("Test");
//jf.add(jp);
//jf.setSize(100,100);
//jf.setVisible(true);
//jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Frame f=new Frame("test");
f.add(p);
f.setSize(100,100);
f.setVisible(true);
}
}
This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb.
ReplyDeleteThis trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolites festivity to pity. I appreciated what you ok extremely here
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
Coding is working.Thank you for sharing.
ReplyDeleteJava training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
This blog is really helpful for my database. It enhanced the area of my thoughts and pushed me beyond the boundaries. Work ethic of every point is different and represent a new way to improve myself.
ReplyDeletehadoop training in chennai
hadoop training in tambaram
salesforce training in chennai
salesforce training in tambaram
c and c plus plus course in chennai
c and c plus plus course in tambaram
machine learning training in chennai
machine learning training in tambaram
It enhanced the area of my thoughts and pushed me beyond the boundaries. Work ethic of every point is different and represent a new way to improve myself.
ReplyDeleteweb designing training in chennai
web designing training in annanagar
digital marketing training in chennai
digital marketing training in annanagar
rpa training in chennai
rpa training in annanagar
tally training in chennai
tally training in annanagar
This blog is really helpful for my database. It enhanced the area of my thoughts and pushed me beyond the boundaries.
ReplyDeletesap training in chennai
sap training in omr
azure training in chennai
azure training in omr
cyber security course in chennai
cyber security course in omr
ethical hacking course in chennai
ethical hacking course in omr
mmorpg oyunlar
ReplyDeleteınstagram takipci satin al
tiktok jeton hilesi
tiktok jeton hilesi
saç ekim antalya
referans kimliği nedir
instagram takipçi satın al
metin2 pvp serverlar
instagram takipçi satın al
perde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
Nft nasil alınır
ankara evden eve nakliyat
trafik sigortası
dedektör
KURMA WEB SİTESİ
aşk kitapları
pendik mitsubishi klima servisi
ReplyDeletetuzla bosch klima servisi
tuzla arçelik klima servisi
çekmeköy samsung klima servisi
ataşehir samsung klima servisi
çekmeköy mitsubishi klima servisi
ataşehir mitsubishi klima servisi
maltepe vestel klima servisi
kadıköy vestel klima servisi
nft nasıl alınır
ReplyDeletelisans satın al
en son çıkan perde modelleri
özel ambulans
uc satın al
en son çıkan perde modelleri
yurtdışı kargo
minecraft premium