.


:




:

































 

 

 

 


.




import java.awt.*;

import java.awt.event.*;

import java.io.*;

public class okno extends Frame implements WindowListener, ItemListener {

public void windowOpened(WindowEvent e) {}

public void windowClosing(WindowEvent e) {

dispose();

System.exit(0); }

public void windowClosed(WindowEvent e) {}

public void windowIconified(WindowEvent e) {}

public void windowDeiconified(WindowEvent e) {}

public void windowActivated(WindowEvent e) {}

public void windowDeactivated(WindowEvent e) {}

 

//

 

CheckboxGroup = new CheckboxGroup();

Checkbox box11 = new Checkbox(" ",false, );

Checkbox box12 = new Checkbox(" 5 ",false, );

Checkbox box21 = new Checkbox(" 15 ",false, );

Checkbox box22 = new Checkbox(" 1,2 ",false, );

Checkbox box23 = new Checkbox(""" ",false, );

Checkbox box31 = new Checkbox(" ",false, );

Checkbox box = new Checkbox(" ",false);

 

public void itemStateChanged(ItemEvent e) {

Object pon = e.getItemSelectable();

if (pon == box11) {

Frame f11 = new oknop1();

f11.addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ev){

System.exit(0);

}

});

}

else

if (pon == box12){

Frame f12 = new oknop2();

f12.addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ev){

System.exit(0);

}

});

}

else

if (pon == box21) {

Frame f21 = new oknop3();

f21.addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ev){

System.exit(0);

}

});

}

else

if (pon == box22) {

Frame f22 = new oknop4();

f22.addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ev){

System.exit(0);

}

});

}

else

if (pon == box23) {

Frame f23 = new oknop5();

f23.addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ev){

System.exit(0);

}

});

}

else

if (pon == box31) {

Frame f31 = new oknop6();

f31.addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ev){

System.exit(0);

}

});

}

else

if (pon == box){

try {

vfail f2 = new vfail();

f2.asd();

} catch (Throwable e2) {

 

e2.printStackTrace();

}

}

}

okno(){

super(" ");

Panel p = new Panel();

add(p, BorderLayout.NORTH);

setLayout(new GridLayout(1, 7));

p.add(box11);

p.add(box12);

p.add(box21);

p.add(box22);

p.add(box23);

p.add(box31);

p.add(box);

 

box11.addItemListener(this);

box12.addItemListener(this);

box21.addItemListener(this);

box22.addItemListener(this);

box23.addItemListener(this);

box31.addItemListener(this);

box.addItemListener(this);

 

addWindowListener(this);

 

setSize(200, 230);

setVisible(true);

}

public static void main(String arg[])

{

new okno();

}

}

 

.

import java.awt.*;

import java.awt.event.*;

public class oknop1 extends Frame implements ActionListener{

private TextField tf1;

private TextField tf;

private TextField tf2;

private TextArea ta;

private TextArea ta1;

private TextArea ta2;

oknop1(){

super (" ");

setLayout(null);

Button bl = new Button("");

bl.setBounds(10,210,160,30);

add(bl);

 

Label ll = new Label(" ", Label.CENTER);

ll.setBounds(10,20,160,30);

tf = new TextField(" ", 50);

tf.setBounds(10,50,160,30);

 

Label ll1 = new Label(" , .", Label.CENTER);

ll1.setBounds(10,80,160,30);

tf1 = new TextField(" ", 50);

tf1.setBounds(10,110,160,30);

 

Label ll2 = new Label(" , .", Label.CENTER);

ll2.setBounds(10,140,160,30);

tf2 = new TextField(" ", 50);

tf2.setBounds(10,170,160,30);

 

Label ch = new Label(" ");

ch.setBounds(10, 250, 160, 30);

ta = new TextArea();

ta.setBounds(10,280,160,50);

 

Label ch1 = new Label(" ");

ch1.setBounds(10, 330, 160, 30);

ta1 = new TextArea();

ta1.setBounds(10,360,160,50);

 

Label ch2 = new Label(" ");

ch2.setBounds(10, 410, 160, 30);

ta2 = new TextArea();

ta2.setBounds(10,440,160,50);

 

add(ll);

add(ll1);

add(ll2);

add(ch);

add(ch1);

add(ch2);

add(ta);

add(ta1);

add(ta2);

add(tf);

add(tf2);

add(tf1);

 

tf.addActionListener(this);

tf1.addActionListener(this);

tf2.addActionListener(this);

bl.addActionListener(this);

 

setSize(200,500);

setVisible(true);

}

 

public void actionPerformed(ActionEvent ae){

 

String x=tf.getText();

double d = Double.parseDouble(x);

 

String x1=tf1.getText();

double d1 = Double.parseDouble(x1);

 

String x2=tf2.getText();

double d2 = Double.parseDouble(x2);

 

zatyx func = new zatyx();

 

String z2 = func.f1(d, d1,d2);

ta1.append(z2);

 

String z4 = func.f4();

ta.append(z4);

 

 

String z3 = func.f3();

ta2.append(z3);

}

}

 

5 - 3,8 .

import java.awt.*;

import java.awt.event.*;

public class oknop2 extends Frame implements ActionListener{

private TextField tf1;

private TextField tf;

private TextField tf2;

private TextArea ta;

private TextArea ta1;

private TextArea ta2;

private TextArea ta3;

//private TextArea ta3;

oknop2(){

super (" 5 ");

setLayout(null);

Button bl = new Button("");

bl.setBounds(10,210,160,30);

add(bl);

 

Label ll = new Label(" ", Label.CENTER);

ll.setBounds(10,20,160,30);

tf = new TextField(" ", 50);

tf.setBounds(10,50,160,30);

 

Label ll1 = new Label(" , .", Label.CENTER);

ll1.setBounds(10,80,160,30);

tf1 = new TextField(" ", 50);

tf1.setBounds(10,110,160,30);

 

Label ll2 = new Label(" , .", Label.CENTER);

ll2.setBounds(10,140,160,30);

tf2 = new TextField(" ", 50);

tf2.setBounds(10,170,160,30);

 

Label ch = new Label(" ");

ch.setBounds(10, 250, 160, 30);

ta = new TextArea();

ta.setBounds(10,280,160,50);

 

Label ch1 = new Label(" ");

ch1.setBounds(10, 330, 160, 30);

ta1 = new TextArea();

ta1.setBounds(10,360,160,50);

 

Label ch2 = new Label(" ");

ch2.setBounds(10, 410, 160, 30);

ta2 = new TextArea();

ta2.setBounds(10,440,160,50);

 

Label ch3 = new Label(" 5 ");

ch3.setBounds(10, 490, 190, 30);

ta3 = new TextArea();

ta3.setBounds(10,520,160,50);

 

add(ll);

add(ll1);

add(ll2);

add(ch);

add(ch1);

add(ch2);

add(ch3);

add(ta);

add(ta1);

add(ta2);

add(ta3);

add(tf);

add(tf2);

add(tf1);

 

tf.addActionListener(this);

tf1.addActionListener(this);

tf2.addActionListener(this);

bl.addActionListener(this);

 

setSize(200,600);

setVisible(true);

}

 

public void actionPerformed(ActionEvent ae){

 

String x=tf.getText();

double d = Double.parseDouble(x);

 

String x1=tf1.getText();

double d1 = Double.parseDouble(x1);

 

String x2=tf2.getText();

double d2 = Double.parseDouble(x2);

 

zatyx func = new zatyx();

 

String z2 = func.f1(d,d1,d2);

ta1.append(z2);

 

String z3 = func.f3();

ta2.append(z3);

 

String z4 = func.f4();

ta.append(z4);

 

String z5 = func.f51(d);

ta3.append(z5);

}

}

 





:


: 2017-02-28; !; : 456 |


:

:

, .
==> ...

1719 - | 1536 -


© 2015-2024 lektsii.org - -

: 0.027 .