volevo fare un programma che prendesse cio che si scriveva in un jtextfield e poi rimettesse cio che elaboro ho gia scritto questo ma non va sapreste aiutarmi il codice e qui:
codice:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Calcolatrice {
	static JFrame window;
	public static void main(String[] args){
		// schedule this for the event dispatch thread (edt)
		SwingUtilities.invokeLater(new Runnable(){
			public void run(){
				displayJFrame();
			}
		});
	}
	static void displayJFrame(){
		window = new JFrame("Test");	
		window.getContentPane().setLayout(new FlowLayout());
		window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		window.setResizable(false);
		window.pack();
		window.setVisible(true);
		JTextField Textarea = new JTextField(16);
		Textarea.setPreferredSize(new Dimension(100,20));
		window.add(Textarea);
		JButton showDialogButton = new JButton("INVIO");
		window.add(showDialogButton);
		showDialogButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent evt) {
				String data = JTextField.getText();
				System.out.println(data);
			}
		});
		JButton p = new JButton("HELP");
		window.add(p);
		p.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				// display/center the jdialog when the button is pressed
				JDialog d = new JDialog(window, "Hello", true);
				d.setLocationRelativeTo(window);
				d.setVisible(true);
			}
		});
	}
}