Buenas, estoy empezando el capitulo de uso de interfaces, y me adelanté un poco viendo que hay software que facilita esta posibilidad.
Me baje el JFrameDesigner, y puse tres texbox, nada complicado, y generé el código java que es este :
Código:
import java.awt.*;
import javax.swing.*;
import com.jgoodies.forms.factories.*;
import com.jgoodies.forms.layout.*;
/*
* Created by JFormDesigner on Sun Feb 26 13:08:33 ART 2012
*/
/**
* @author Axel
*/
public class java extends JFrame {
public java() {
initComponents();
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
dialogPane = new JPanel();
contentPanel = new JPanel();
buttonBar = new JPanel();
okButton = new JButton();
cancelButton = new JButton();
textField3 = new JTextField();
textField4 = new JTextField();
textField5 = new JTextField();
//======== this ========
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
//======== dialogPane ========
{
dialogPane.setBorder(Borders.DIALOG_BORDER);
dialogPane.setLayout(new BorderLayout());
//======== contentPanel ========
{
contentPanel.setLayout(new FormLayout(
"6*(default, $lcgap), default",
"2*(default, $lgap), default"));
}
dialogPane.add(contentPanel, BorderLayout.NORTH);
//======== buttonBar ========
{
buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
buttonBar.setLayout(new FormLayout(
"$glue, $button, $rgap, $button",
"pref"));
//---- okButton ----
okButton.setText("OK");
buttonBar.add(okButton, CC.xy(2, 1));
//---- cancelButton ----
cancelButton.setText("Cancel");
buttonBar.add(cancelButton, CC.xy(4, 1));
}
dialogPane.add(buttonBar, BorderLayout.SOUTH);
dialogPane.add(textField3, BorderLayout.WEST);
dialogPane.add(textField4, BorderLayout.EAST);
dialogPane.add(textField5, BorderLayout.CENTER);
}
contentPane.add(dialogPane, BorderLayout.CENTER);
pack();
setLocationRelativeTo(getOwner());
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JPanel dialogPane;
private JPanel contentPanel;
private JPanel buttonBar;
private JButton okButton;
private JButton cancelButton;
private JTextField textField3;
private JTextField textField4;
private JTextField textField5;
// JFormDesigner - End of variables declaration //GEN-END:variables
}
El problema es que no se como solucionar el error que me tira en :
Código:
import com.jgoodies.forms.factories.*;
import com.jgoodies.forms.layout.*;
Seleccionandome com.jgoodies
Código:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Borders cannot be resolved
FormLayout cannot be resolved to a type
Borders cannot be resolved
FormLayout cannot be resolved to a type
CC cannot be resolved
CC cannot be resolved
Desde ya, les agradezco mucho su ayuda !