Wednesday, February 3, 2010

Dog On Freighter Cruise To Australia

Write a word on a label on the Cartesian axes


the exercise was to write text in a text box (JTextField) that once clicked a button (JButton) was copied to a label (JLabel).

import java.awt .*;
import javax.swing .*;
import java.awt.event .*;

public class Word {JFrame f1 = new JFrame ("Show password");
JButton b1 = new JButton ("Go");
R1 = new JLabel JLabel ();
JLabel inv = new JLabel ();
JTextField t1 = new JTextField ();
public Word () {
f1.setSize (300.300);
f1.setVisible (true);
& # 160; f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f1.add(BorderLayout.NORTH,t1);
        f1.add(BorderLayout.SOUTH,b1);

        f1.add(BorderLayout.CENTER,r1);

        b1.addActionListener(new Bottone());
    }
    public static void main(String args[]){
        Parola p=new Parola();
    }
    public class Bottone implements ActionListener{

        public void actionPerformed(ActionEvent e){

}}











0 comments:

Post a Comment