'file to byte'에 해당되는 글 1건

  1. 2007.11.29 Java File to Byte
2007.11.29 21:36

Java File to Byte

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

public class CompValidateExample extends JFrame implements ActionListener 
{
	JButton b = null;
	JLabel l = null;
	
	public CompValidateExample() {
		this.setLayout(new GridLayout(1,3));
		
		b = new JButton("Show Label");
		b.addActionListener(this);
		
		this.add(b);
		
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setSize(300, 100);
		this.setVisible(true);
	}
	
	public void actionPerformed(ActionEvent evt) {
		if(evt.getSource().equals(b)) {
			l = new JLabel("It's Label");
			
			this.add(l);
			this.validate();
		}
	}
	
	public static void main(String[] args) {
		new CompValidateExample();
	}
}
Trackback 0 Comment 0