Copying data from jTextField1 automatically

Copying data from jTextField1 automatically

I am making human resource management system. Copying data from jTextField1 automatically when user enter value in jTextField1 to jTextField2 , jTextField3 .. Each jTextField in different panes of jTabbedPane. There are 4 tabs in jTabbedPane.

Each tab has a many jTextField but one jTextField is common to all. jTextField which hold the value of employee id is in each of 4 tabs.

I want , When user enter value in jTextField1 in 1st tab , simultaneously the same value entered by user be in jTextfield1 be copied to jTextField2 , jTextField3 in other tabs(same value of employee id given by user in jTextfield1 should be in other TextField of other tabs which hold the value of employee id)

Please Help me !! I am making my project , and solution is urgently required .. my email id is : [email protected]

View Answers

April 6, 2012 at 11:50 AM

import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

class TabbedPaneExample {
JFrame f;
JPanel p1,p2,p3,p4;
JTabbedPane tp;
JLabel l1, l2, l3, l4,l5,l6,l7,l8;
JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8;
JButton savebtn,resetbtn,editbtn1,editbtn2,deletebtn ;

TabbedPaneExample(){
f=new JFrame("Form");
p1=new JPanel(new GridLayout(2,2));
p2=new JPanel(new GridLayout(2,2));
p3=new JPanel(new GridLayout(2,2));
p4=new JPanel(new GridLayout(2,2));

tp=new JTabbedPane();
l1=new JLabel("ID:");
l2=new JLabel("Name:");
l3=new JLabel("ID:");
l4=new JLabel("Address:");
l5=new JLabel("ID:");

l6=new JLabel("Contact No:");
l7=new JLabel("ID:");
l8=new JLabel("Email:");

tf1=new JTextField(12);
tf2=new JTextField(12);
tf3=new JTextField(12);
tf4=new JTextField(12);
tf5=new JTextField(12);
tf6=new JTextField(12);
tf7=new JTextField(12);
tf8=new JTextField(12);

p1.add(l1);
p1.add(tf1);
p1.add(l2);
p1.add(tf2);
p2.add(l3);
p2.add(tf3);
p2.add(l4);
p2.add(tf4);

p3.add(l5);
p3.add(tf5);
p3.add(l6);
p3.add(tf6);

p4.add(l7);
p4.add(tf7);
p4.add(l8);
p4.add(tf8);

tf1.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e){
tf3.setText(tf1.getText());
tf5.setText(tf1.getText());
tf7.setText(tf1.getText());
}
});
}
void dis()
{
f.getContentPane().add(tp);
tp.addTab("Tab1",p1);
tp.addTab("Tab2",p2);
tp.addTab("Tab3",p3);
tp.addTab("Tab4",p4);

f.setSize(350,180);
f.setVisible(true);
f.setResizable(true);
}
public static void main(String z[]){
TabbedPaneExample pro=new TabbedPaneExample();
pro.dis();
}
}

April 6, 2012 at 9:14 PM

Thank you sooooooo much!!









Related Tutorials/Questions & Answers:
How to Pass data from jTextField1 in jFrame1 to jLabel1 in jFrame2
How to Pass data from jTextField1 in jFrame1 to jLabel1 in jFrame2  I have a Form login_pass (jFrame) which has a jTextField1 to take input (employee id) from the user. I want that the value of employee id given by user
copying data from one table to another
copying data from one table to another  i need to copy data from one table to another table.. i.e the 1st eid of employee table must be copied to the 1st eid in appusers table, 2nd eid of employee to the 2nd eid of appusers
Advertisements
automatically move next page when data fetched from database is stored in text field
automatically move next page when data fetched from database is stored in text field  hi I have php page where i have two text fields . The data are stored in database wherein when the in the first text field the data is already
Copying and Moving data using drag and drop
Copying and Moving data using drag and drop: You can drag and drop the data from list to dataGrid using different data formats in this example. When you move data and add it to the drop target it will be removed from draginitiator
extract data from HTML
extract data from HTML  how to write the coding for to extract data from html tags like(h3,p) and then extracted data should be stored in data base? can anybody tell me how to write the coding
data science from iim
data science from iim  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science from... the topic "data science from iim". Also tell me which is the good
data analytics from iim
data analytics from iim  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data analytics... the topic "data analytics from iim". Also tell me which is the good
Data from multiple ResultSets?
Data from multiple ResultSets?  hello, How can I get data from multiple ResultSets?   Hi,ADS_TO_REPLACE_1 You can iterate the ResultSet separately and get the required data. Thanks
selecting data from database
selecting data from database  how to select data from database using Dao in struts   Hi, You have to load the data from database using hibernate and send the data in a Java file object to jsp page.ADS_TO_REPLACE_1
Select data from diplicated data
Select data from diplicated data  hello i have table location... location FROM (".$is.") WHERE sub_cat=('".$id."')"; $result = mysql_query($SQL...++) { $SQL = "SELECT duration FROM core_network WHERE location=('".$location_c[$k
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... an example to insert data from file. To understand this example, we create
retrive data from database
retrive data from database   hi.. i made a application form. it's have attribute s.no,name,roll no and i enter a few records. now i want to view all record not in database access sheet i want to view it at any another
retrive data from database?
retrive data from database?  hellow i have a database sheet name as db1. it's contain sixty(60) sn,name ,rollno(primary key),father's name etc... from db1 and enter value in text box according there name,rollno and save
how to move curosr from one text field to another automatically when the first textfield reaches its maximum length
how to move curosr from one text field to another automatically when the first textfield reaches its maximum length  how to move curosr from one text field to another automatically when the first textfield reaches its maximum
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... an example to insert data from file. To understand this example, we create
Retrieve data from database in swing application
Retrieve data from database in swing application  I want to retrive data(doctor name,specilization,date) from my sql database...(); ResultSet rs=st.executeQuery("select * from data where id=1"); while
parse data from a link in java
parse data from a link in java  Hi, Here I want code for Extracting data from a link and the data a must be stored in mysql and then I need to display the data in a jsp page
fetch data from database in javascript
fetch data from database in javascript   How to fetch data from database in JavaScript when it is a leap year
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to fetch data from servlet ????
how to fetch data from servlet ????  how to fetch data from servlet
To retrive data from database - Struts
To retrive data from database  How to get values ,when i select a select box in jsp and has to get values in textbox automatically from database? eg... come to jsp page automatically from database
uploading and copying files
uploading and copying files  how can i upload and copy one file based on the given inputs and copy it from one directory to another
Getting data from servlet into javascript
Getting data from servlet into javascript  How do i get json data from my servlet on to a variable in javascript n bind the data to display onto sigma grid.Has anyone Idea how to do
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
how to retrieve data from database
how to retrieve data from database  unable to retrieve data from database using mySQL by using jsp sessions and beans for editing
data science course from iit
data science course from iit  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data... can learn the topic "data science course from iit". Also tell me
learn data science from scratch
learn data science from scratch  Hi, I am beginner in Data Science... data science from scratch Try to provide me good examples or tutorials links so that I can learn the topic "learn data science from scratch". Also
data science jobs from home
data science jobs from home  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data... can learn the topic "data science jobs from home". Also tell me which
data science course from iim
data science course from iim  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data... can learn the topic "data science course from iim". Also tell me
Data extraction from an image file.
Data extraction from an image file.  I have made an image... data from the the image which also include deleted data.Can i used java to extract these data from the image file? Which are the libraries to be used
Retrieve The Data From MySql Datbase
Retrieve The Data From MySql Datbase   How to Retrieve The Data From MYSQL database TO Use Select the Emp_id Option.And Also Search Option
delete data from database - SQL
delete data from database  HOw to delete specific data from table> I want to delete one record from database. Thnx  Hi friend, -------------------------------------------- Visit for more information
How to delete data from MySQL?
How to delete data from MySQL?  Hi, How I can conditionally delete the data from MySQL Table? Thanks   Hi, You can use the where clause to conditionally delete the data from MySQL database table. Here is some query
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project... is text and all others are of currency data type. If i enter 0 or null value in currency column and then try to retrieve data using my servlet coding
retrieve data from database with hyperlink
retrieve data from database with hyperlink  sir....i have one table called 'name' having two values i have to retrieve those data with a hyperlink and show in browser and if we click hyperlink its shows his sub categories....how
FAILED TO INSERT DATA FROM FUNCTION();
FAILED TO INSERT DATA FROM FUNCTION();  HELLO, I HAVE A PROBLEM TO INSERT DATA FROM OUTPUT FROM FUNCTION()... I WANT TO STORE THE OUTPUT IN DATABASE...(){ $query1 = "SELECT AVG(MAC) FROM academia1"; $result1 = mysqlquery($query1
retrieve data from mysql database
retrieve data from mysql database  hi am not familiar in php.....even... selected value on combobox which is to be retrieve the relevant data from mysql... * from testtable where Fname like '%$term%'"); while ($row = mysql<em>
Purge Data from Mysql tables
Purge Data from Mysql tables  Hi, i have to write a mysql procedure to purge data from tables. but written procedure clear entire tables data. Please give me the solution for purging data. CREATE DEFINER=`root`@`localhost
Python extract data from JSON
Python extract data from JSON  Hi, I have a program that reads json data from third part web service. My webservice is returning json and I am..., For parsing and getting the data from JSON. You can use the json library which ships
store data from a variable in mysql?
store data from a variable in mysql?  sir last time asked you tell me how to retrieve data from a database mysql and store it in an int variable... of the calculation from an int variable into mysql in a new table of database. how
Retrieving specific data from excel
Retrieving specific data from excel  Hello everyone, i have written a simple code to retrieve data from excel sheet and working fine, the excel file... first sheet from the workbook HSSFSheet sheet = workbook.getSheetAt(0
GWT -- retrive the data from Database
GWT -- retrive the data from Database  the user can create an event. In the create page, we have three buttons. Save as draft, preview and save... button, you have to create a dynamic jsp which should read the contents from
view data from jTextArea to jtable
view data from jTextArea to jtable  good night Please help senior java all, I want to make a brief program of reading data in the text area and then on the show to the j table. I created a new scrip like below but it does
retrive data from oracle to jsp
retrive data from oracle to jsp  i am a beginer in jsp so please help... cost and manager name and storing it in the data base. in search proj fiel...(); psmt= conn.prepareStatement("select * from CR_EMPLOYEE_DETAILS
Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example... from the dropdown, related data will get displayed on the textboxes. Here we have...("name").toString(); String data=""; Connection conn = null; String url = "jdbc
retreive integer data from database
retreive integer data from database  i made a table named result... and two buttons "ok" and "cancel" i want to take input from textfield...=lalit&database=mydb"); String url="select marks from student where rollno
Getting Textbox data from database
Getting Textbox data from database  When i m trying to get data in textbox as readonly from database i m getting following error.and my code is shown... data from database and display it on the textboxes. <%@page language="java

Ads