JComboBox
JSFS. SetPreferredSize (new Dimension (20), 100);
JSFS. AddItem (" ");
JSFS. AddItem (" according to the area, the unit price calculation ");
JSFS. AddItem (" calculate according to the total loans ");
JSFS. SetBounds (10,30,100,20);
P.a dd (JSFS);
SetVisible (true);
Double DKZE=0;
JSFS. AddItemListener (new ItemListener ()
{
Public void itemStateChanged (ItemEvent e) {
Double DKZE;
If (JSFS getSelectedIndex ()==1) {
JTextArea DJ1=new JTextArea ();
DJ1. SetText (" price: ");
DJ1. SetOpaque (false);
DJ1. SetBounds (10,60,40,20);
P.a dd (DJ1);
JTextField DJI=new JTextField ();
Average. SetBounds (50,60,100,20);
P.a dd (average);
JTextArea DJ2=new JTextArea ();
DJ2. SetText (" yuan/square meters ");
DJ2. SetOpaque (false);
DJ2. SetBounds (160,60,50,20);
P.a dd (DJ2);
JTextArea MJ1=new JTextArea ();
MJ1. SetText (" area: ");
MJ1. SetOpaque (false);
,90,40,20 MJ1. SetBounds (10);
P.a dd (MJ1);
JTextField MJI=new JTextField ();
MJI. SetBounds (50,90,100,20);
P.a dd (MJI);
JTextArea MJ2=new JTextArea ();
MJ2. SetText (" square ");
MJ2. SetOpaque (false);
MJ2. SetBounds (160,90,50,20);
P.a dd (MJ2);
SetVisible (true);
Double DJ=double. The valueOf (average. The getText (), toString ());
Double MJ=double. The valueOf (MJI. GetText (), toString ());
DKZE=DJ * Jackson;
}
}
}
);
Return DKZE;
}
How to put the inner class DKZE returns to the outside? Or in the external to internal DKZE assignment?
CodePudding user response:
Don't know what you said what relationship in external, you first find out two classes who call who, by calling the transfer value,CodePudding user response: