bem galera eu fiz uma interface grafica so que os butoes nao funcionam as acoes dele me ajudem...
package conversor;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JButton;
//import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class Tela extends JFrame implements WindowListener, ActionListener {
JButton botaoCancelar, botaoConverter, botaoCaminhoC, botaoCaminhoPascal;
JPanel fundo;
JLabel labelCamC, labelCamPascal, labelErro;
JTextField caminhoC, caminhoPascal;
public Tela() {
getContentPane().setLayout(null);
setTitle("Comercio ID");
setBackground(Color.WHITE);
setBounds(500, 300, 400, 400);
fundo = new JPanel();
fundo.setLayout(null);
fundo.setBackground(Color.YELLOW);
fundo.setBounds(0, 0, 400, 400);
labelCamC = new JLabel("Coloque o caminho do arquivo C:");
labelCamC.setBounds(0, 10, 200, 25);
caminhoC = new JTextField("");
caminhoC.setLayout(null);
caminhoC.setBackground(Color.white);
caminhoC.setBounds(0, 35, 250, 25);
caminhoC.setEnabled(false);
botaoCaminhoC = new JButton("...");
botaoCaminhoC.setForeground(Color.red);
botaoCaminhoC.setBounds(260, 35, 50, 25);
labelCamPascal = new JLabel("Coloque o caminho do arquivo Pascal:");
labelCamPascal.setBounds(0, 70, 250, 25);
caminhoPascal = new JTextField("");
caminhoPascal.setLayout(null);
caminhoPascal.setBackground(Color.white);
caminhoPascal.setBounds(0, 90, 250, 25);
caminhoPascal.setEnabled(false);
botaoCaminhoPascal = new JButton("...");
botaoCaminhoPascal.setForeground(Color.red);
botaoCaminhoPascal.setBounds(260, 90, 50, 25);
botaoConverter = new JButton("Converter");
botaoConverter.setForeground(Color.red);
botaoConverter.setBounds(0, 170, 100, 25);
botaoCancelar = new JButton("Cancelar");
botaoCancelar.setForeground(Color.red);
botaoCancelar.setBounds(110, 170, 100, 25);
labelErro = new JLabel("");
labelErro.setBounds(0, 130, 200, 25);
labelErro.setForeground(Color.red);
fundo.add(labelErro);
fundo.add(labelCamC);
fundo.add(botaoCancelar);
fundo.add(botaoConverter);
fundo.add(botaoCaminhoPascal);
fundo.add(caminhoPascal);
fundo.add(labelCamPascal);
fundo.add(caminhoC);
fundo.add(botaoCaminhoC);
getContentPane().add(fundo);
super.addWindowListener(this);
}
public void windowClosed(WindowEvent Evento) {
this.dispose(); // desalocar objetos da memória
System.exit(0); // retorna ao Sistema Operacional
}
public void windowClosing(WindowEvent Evento) {
}
public void windowDeactivated(WindowEvent Evento) {
}
public void windowActivated(WindowEvent Evento) {
}
public void windowIconified(WindowEvent Evento) {
}
public void windowDeiconified(WindowEvent Evento) {
}
public void windowOpened(WindowEvent Evento) {
}
// Implementação do controle de eventos para botões na interface
public void actionPerformed(ActionEvent Evento) {
Object objetoRecebeuEvento;
objetoRecebeuEvento = Evento.getSource();
if (objetoRecebeuEvento == botaoCancelar) {
this.dispose(); // desalocar objetos da memória
System.exit(0);
}
if (objetoRecebeuEvento == botaoCaminhoC) {
}
if (objetoRecebeuEvento == botaoCaminhoPascal) {
}
if (objetoRecebeuEvento == botaoConverter) {
}
}
}