Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT Copying data from jTextField1 automatically
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Priyanjan
Copying data from jTextField1 automatically
2 Answer(s)      2 years and 8 months ago
Posted in : Swing AWT


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 : priyanjan.kumar19@gmail.com


Advertisement
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
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
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
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
Copying an array to another
to copy data from one array to another. Here, providing you an example with code... Copying an array to another     ... the array1.length.  We use the 'for' loop statement for displaying and copying
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
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 from multiple ResultSets?
Data from multiple ResultSets?  hello, How can I get data from multiple ResultSets?   Hi, 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. Please read at http
Java - Copying one file to another
for copying files from one hard drive to another hard drive. Download File Copy... Java - Copying one file to another   ... how to copy contents from one file to another file. This topic is related
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
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... to insert data from file. To understand this example, we create a table 'Stu_Table
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
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
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... to insert data from file. To understand this example, we create a table 'Stu_Table
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
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  unable to retrieve data from database using mySQL by using jsp sessions and beans for editing
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
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
Data Capture from resume - JSP-Servlet
Data Capture from resume  Hi Sir, In My Application, when i Upload a resume the relevant columns like name,phone,email,skills etc need to be captured automatically and must be stored into the database. Please solve
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
Advertisements
 

 

 

DMCA.com