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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


raja
Query
1 Answer(s)      4 years and a month ago
Posted in : Swing AWT


How can i call a static variable of one class to another class.

can i change static varibale value.

//A.java
public class A { static JTextField p=null; static int k; public A() { } public actionPerformed(ActionEvent ae) { k=Integer.parseInt(p.getText()); //Some Condition B=new B(); public static void main() { } }

//B.java

public class B { static int l=A.k; public B() { C p=new C(); } public static void main(String args[]) { } }

// //C.java

public class c {

public c() {

} public actionPerformed(Actione Event ae) { A l=new A(); } public static void main(String args[]) { } }

during first life cycle i got original values but when i called second time it shows previous value. please help me

for example if i have given k=9 for first life cycle the output also 9 but during second life cycle i have given k=18 it shows output as 9 answer me please


Advertisement
View Answers

December 3, 2010 at 1:04 PM


Hi Friend,

Please visit the following link:

Get JTextfield value from another class

Thanks



Related Tutorials/Questions & Answers:
query in JDBC
query in JDBC  What are the steps required to execute a query in JDBC
query string
query string  Need some examples of query strings.send me as soon as possible. Regards, R.Santhosh
Advertisements
query optimization
query optimization  hai ! i need a code in java for database query optimization.plz help
Query Question
Query Question  How would I write a query to display the name, department of the employee that earns the highest salary in the Employees table
HQL Query
HQL Query  Hibernate query language: How to use a left join in Hibernate query language. Can somebody help with an example. I am getting a unexpected token error in HQL Query tool If I use joins
jdbc query
jdbc query  write a query of how to print the values of any column present in database in reverse order
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2
database Query
database Query  i have to find common columns from two tables fron 2 differnt schemas what query to use? i used intersect but i am not getting how it is comapring two tables from different schema because in query we have
database Query
database Query  i have to find common columns from two tables from 2 different schemas what query to use? i used intersect but i am not getting how it is comparing two tables from different schema because in query we have
sql query
sql query  two tables are emp,loc write a query to display all the emp information whose locname not equal to bangalore
session into a query
session into a query  Hi all this am Sreedhar from Hyderabad i am calling one session variable in mysql query but its not working can any one help me please... here is the query.. $query = 'SELECT * FROM post WHERE post_date <
query problem
query problem  how write query in jsp based on mysql table field? i have employee table it contain designation field, how write query in jsp... to write this query in jsp please anybody help me, and send me that code
SQL Query
SQL Query  Selecting the third highest salary of Employee without using any subquery?   Here is a query: SELECT salary FROM employee ORDER BY salary DESC LIMIT 2,1
HQL query
HQL query  how to select only password based on username using HQL query from login table where uname and paswrd are two column names
Advertisements
 

 

 

DMCA.com