Code Example

 

package test;

import gui.components.JIntField;

import java.awt.GraphicsConfiguration;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class TestFrame extends JFrame {

	private JIntField in;
	private JButton b;

	public TestFrame() throws HeadlessException {


		in = new JIntField();
		
		b = new JButton();
		b.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				System.out.println(getNumber());
			}
		});
		
		
		this.add(in);
		this.add(b);
		
		this.setVisible(true);
		this.setSize(500, 500);
	}

	public int getNumber(){
		return in.getNumber();
	}


}


"