I want to call a variable in another application

Greetings,

I asked previously a similar question but I didn't got a solution to my problem, so i'll explain in details my problem:

I have a Java File called Senior.java, and another one called Properties.java

Properties.java is a dialog box that I can open from the main application Senior.java using Tools > Properties command.

Now, in Properties I have Radio buttons, and In Senior I have a JButton that upon clicking should run a process depending on what I choose in the properties dialog box.

One solution I thought about is to retun a number for every Radio Button and store this number in an integer variable "action".

Now I want from Senior to know the value of action.

Some code from properties.java:

[code]:

public class Properties extends JFrame

{...............

private int action;

public Properties()

{ // Creating the Radio Buttons and set visible ............................

}

public static void main( String args[] )

{

Properties application = new Properties();

application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

}

private class RadioButtonHandler implements ItemListener

{

public void itemStateChanged( ItemEvent event )

{

if (event.getSource()==adfButton)

action = 1;

else if ( event.getSource()== normalButton )

action = 2;

else if ( event.getSource()== hiddenButton )

action = 3;

}

}

/*public int getAction()

{

return action;

}

*/

Any Suggesstions

Thanks in Advanced

M.Tleis

[1656 byte] By [Java_scientist] at [2007-9-30 20:54:11]
# 1
Declare the variable "action" as public and try.If you don't get the expected result post a reply.
Aswin at 2007-7-7 2:27:00 > top of Java-index,Administration Tools,Sun Connection...
# 2
if I change private into public I got the following compilation error in the main file Senior.java:Senior.java [122:1] non-static variable action cannot be referenced from a static context
Java_scientist at 2007-7-7 2:27:00 > top of Java-index,Administration Tools,Sun Connection...
# 3

sorry, the previous compilation error is due to a mistake I did in my code.

the actual problem is, when I change private to public, the main class of Properties.java will be executed, for this reason when I click the JButton in my main software ( Senior.java ) the properties dialog box will appear. while I only need the value of the varialbe action, without running the whole Properties.java

Java_scientist at 2007-7-7 2:27:00 > top of Java-index,Administration Tools,Sun Connection...