本文整理汇总了Java中javax.swing.JTextField.setColumns方法的典型用法代码示例。如果您正苦于以下问题:Java JTextField.setColumns方法的具体用法?Java JTextField.setColumns怎么用?Java JTextField.setColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextField
的用法示例。
在下文中一共展示了JTextField.setColumns方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.swing.JTextField; //导入方法依赖的package包/类
public static void main(String[] args) {
JTextFieldDemo1();
final JFrame f = new JFrame("Welcome To Earth!");
final JTextField name = new JTextField(30);
final JTextField noed = new JTextField("HJW", 10);
final JLabel nameLab = new JLabel("�����û�����:");
final JLabel noedLab = new JLabel("���ɱ༭�ı� ");
noed.setEnabled(false);
name.setColumns(30);
noed.setColumns(30);
f.setLayout(new GridLayout(3, 2));// ���ò��ֹ�����
f.add(nameLab);
f.add(name);
f.add(noedLab);
f.add(noed);
f.setSize(300, 100);
f.setLocation(300, 200);
f.setVisible(true);
}
示例2: UserCredentialsPanel
import javax.swing.JTextField; //导入方法依赖的package包/类
public UserCredentialsPanel(){
setSize(new Dimension(900, 300));
setPreferredSize(new Dimension(900, 300));
setMinimumSize(new Dimension(450, 300));
setLayout(null);
JLabel lblUsername = new JLabel("Username");
lblUsername.setBounds(12, 12, 86, 15);
add(lblUsername);
JLabel lblPassword = new JLabel("Password");
lblPassword.setBounds(12, 49, 70, 15);
add(lblPassword);
usernameField = new JTextField();
usernameField.setBounds(116, 10, 114, 19);
add(usernameField);
usernameField.setColumns(10);
passwordField = new JPasswordField();
passwordField.setBounds(116, 47, 114, 19);
add(passwordField);
}
示例3: Busqueda
import javax.swing.JTextField; //导入方法依赖的package包/类
public Busqueda(Connection conn, JFrameJTable principal, String sql, char QuienEs) {
setIconImage(Toolkit.getDefaultToolkit().getImage(Busqueda.class.getResource("/biblioteca/images/book.png")));
this.QuienEs=QuienEs;
this.conn=conn;
this.principal=principal;
this.principal.setEnabled(false);
setTitle("B�squeda");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 492, 370);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
txtUsuario = new JTextField();
txtUsuario.setBounds(10, 33, 328, 23);
contentPane.add(txtUsuario);
txtUsuario.setColumns(10);
txtUsuario.addKeyListener(this);
btnBuscar = new JButton("Buscar");
btnBuscar.setBounds(357, 32, 109, 23);
contentPane.add(btnBuscar);
btnBuscar.addActionListener(this);
table = new PanelJtable(conn,sql,this);
table.setBounds(10, 78, 456, 242);
contentPane.add(table);
addWindowListener(this);
setVisible(true);
setLocationRelativeTo(null);
}
示例4: getAccesoryPanel
import javax.swing.JTextField; //导入方法依赖的package包/类
@Messages("LBL_IconInfo=Selected icon [size]:")
private static JPanel getAccesoryPanel(final JTextField iconInfo) {
iconInfo.setColumns(15);
iconInfo.setEditable(false);
JPanel accessoryPanel = new JPanel();
JPanel inner = new JPanel();
JLabel iconInfoLabel = new JLabel();
accessoryPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0));
inner.setLayout(new GridLayout(2, 1, 0, 6));
iconInfoLabel.setLabelFor(iconInfo);
Mnemonics.setLocalizedText(iconInfoLabel, LBL_IconInfo());
inner.add(iconInfoLabel);
inner.add(iconInfo);
accessoryPanel.add(inner);
return accessoryPanel;
}
示例5: _QueryFunction_JComponent_pjer6y_a0a0n0a
import javax.swing.JTextField; //导入方法依赖的package包/类
private JComponent _QueryFunction_JComponent_pjer6y_a0a0n0a() {
JPanel panel = new JPanel();
ImageIcon imageIcon = new ImageIcon();
JLabel label = new JLabel(SPropertyOperations.getString(myNode, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), imageIcon, JLabel.LEFT);
JTextField textField = new JTextField();
textField.setColumns(35);
{
final SNode uitTeVoerenDialoog = ListSequence.fromList(SModelOperations.nodes(SNodeOperations.getModel(myNode), MetaAdapterFactory.getConcept(0x15970de38fe74b13L, 0x81c738b38d51c39aL, 0x77d59dfe8d9bbd90L, "Simulatie.structure.UitTeVoerenDialoog"))).first();
if (SNodeOperations.isInstanceOf(uitTeVoerenDialoog, MetaAdapterFactory.getConcept(0x15970de38fe74b13L, 0x81c738b38d51c39aL, 0x77d59dfe8d9bbd90L, "Simulatie.structure.UitTeVoerenDialoog"))) {
SNode waarde = InstantieVanObject__BehaviorDescriptor.GeefWaardeVanKenmerk_idFR9FxGLp3H.invoke(SLinkOperations.getTarget(uitTeVoerenDialoog, MetaAdapterFactory.getReferenceLink(0x15970de38fe74b13L, 0x81c738b38d51c39aL, 0x77d59dfe8d9bbd90L, 0x690f11b6e01d86a4L, "onderwerp")), myNode);
textField.setText(Waarde__BehaviorDescriptor.GeefWaardeString_idFzw$g_H4hz.invoke(waarde));
}
}
panel.add(label);
panel.add(textField);
return panel;
}
示例6: ViewAlkaneLengthSelection
import javax.swing.JTextField; //导入方法依赖的package包/类
public ViewAlkaneLengthSelection(String frameTitle){
super(frameTitle);
this.setMinimumSize(new Dimension(500,200));
alkaneSpherePanel = new JPanel();
this.add(alkaneSpherePanel);
closeWindow = new JButton("Cancel");
saveValues = new JButton("Save");
GridBagLayout gridbagOtherParam = new GridBagLayout();
alkaneSpherePanel.setLayout(gridbagOtherParam);
NoOfSpheres = new JTextField();
NoOfSpheres.setColumns(10);
NoOfSpheres.setSize(new Dimension(5,20));
NoOfSpheres.setText("4");
JLabel NLabel = new JLabel("Cn (where n is 4 or greater)");
NLabel.setLabelFor(NoOfSpheres);
Border compoundField1;
compoundField1 = BorderFactory.createCompoundBorder(
BorderFactory.createRaisedBevelBorder(), BorderFactory.createLoweredBevelBorder());
NoOfSpheres.setBorder(compoundField1);
JComponent[] OtherParamLeft= {NLabel,saveValues};
JComponent[] OtherParamRight = { NoOfSpheres,closeWindow};
addLeftRightComponents(OtherParamLeft,OtherParamRight,gridbagOtherParam,alkaneSpherePanel);
}
示例7: AddBreakPoint
import javax.swing.JTextField; //导入方法依赖的package包/类
/**
* Create the frame.
*/
public AddBreakPoint(DefaultListModel<BreakPoint> breakpoint) {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JComboBox<Object> comboBox = new JComboBox<Object>();
comboBox.setModel(new DefaultComboBoxModel<Object>(Variable.values()));
comboBox.setBounds(10, 115, 141, 20);
contentPane.add(comboBox);
textField = new JTextField();
textField.setBounds(226, 115, 141, 20);
contentPane.add(textField);
textField.setColumns(10);
JButton btnAddBreakpoint = new JButton("Add BreakPoint");
btnAddBreakpoint.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Object val = null;
String text = textField.getText().toLowerCase();
if(text.equals("true"))
val = true;
else if(text.equals("false"))
val = false;
else{
val = Integer.parseInt(text, 16);
}
breakpoint.addElement(new BreakPoint((Variable) comboBox.getSelectedItem(),val));
setVisible(false);
dispose();
}
});
btnAddBreakpoint.setBounds(138, 191, 141, 23);
contentPane.add(btnAddBreakpoint);
}
示例8: StringControl
import javax.swing.JTextField; //导入方法依赖的package包/类
public StringControl(final Object f, PropertyDescriptor p) {
super();
final String name = p.getName();
final Method r = p.getReadMethod(), w = p.getWriteMethod();
setterMap.put(name, this);
clazz = f;
write = w;
read = r;
setLayout(new GridLayout(1, 0));
// setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
setAlignmentX(ALIGNMENT);
final JLabel label = new JLabel(name);
label.setAlignmentX(ALIGNMENT);
label.setFont(label.getFont().deriveFont(fontSize));
addTip(p, label);
add(label);
textField = new JTextField(name);
textField.setFont(textField.getFont().deriveFont(fontSize));
textField.setHorizontalAlignment(SwingConstants.LEADING);
textField.setColumns(10);
add(label);
add(textField);
refresh();
textField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
w.invoke(clazz, textField.getText());
} catch (Exception e2) {
e2.printStackTrace();
}
}
});
}
示例9: EmitterPanel
import javax.swing.JTextField; //导入方法依赖的package包/类
public EmitterPanel() {
TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_emitter"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
setBorder(border);
JLabel lblShadowType = new JLabel(Resources.get("panel_emitterType"));
textFieldType = new JTextField();
textFieldType.setColumns(10);
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap()
.addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(textFieldType, GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)
.addContainerGap()));
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
.addComponent(textFieldType, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
setLayout(groupLayout);
this.setupChangedListeners();
}
示例10: Channel
import javax.swing.JTextField; //导入方法依赖的package包/类
/**
* Create the frame to choose the channel
*/
public Channel() {
this.setTitle("Chat IRC");
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setBounds(100, 100, 460, 261);
this.setLocationRelativeTo(null);
setIconImage(Toolkit.getDefaultToolkit().getImage(Channel.class.getResource("/image/swag.png")));
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnOk = new JButton("OK");
Icon imgOk = new ImageIcon(Toolkit.getDefaultToolkit().getImage(Channel.class.getResource("/image/ok.png")));
btnOk.setIcon(imgOk);
btnOk.setFont(new Font("Tahoma", Font.BOLD, 14));
btnOk.addActionListener(new ChannelListener());
btnOk.setBounds(164, 152, 104, 30);
contentPane.add(btnOk);
JLabel lblChannel = new JLabel("Channel");
lblChannel.setHorizontalAlignment(SwingConstants.LEFT);
lblChannel.setFont(new Font("Tahoma", Font.BOLD, 14));
lblChannel.setBounds(187, 30, 72, 30);
contentPane.add(lblChannel);
textFieldChannel = new JTextField();
textFieldChannel.setFont(new Font("Tahoma", Font.PLAIN, 14));
textFieldChannel.setBounds(115, 85, 203, 30);
contentPane.add(textFieldChannel);
textFieldChannel.setColumns(10);
this.addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e) {
closeFrame();
}
});
}
示例11: PasswordManagerRegistration
import javax.swing.JTextField; //导入方法依赖的package包/类
public PasswordManagerRegistration(PasswordManagerGUI gui) {
this.gui = gui;
regpanel = new JPanel();
regpanel.setLayout(new BorderLayout(0, 0));
JPanel panel_1 = new JPanel();
regpanel.add(panel_1, BorderLayout.NORTH);
JLabel lblRegistration = new JLabel(Labels.REG_REGISTRATION);
lblRegistration.setFont(new Font("Tahoma", Font.PLAIN, 38));
panel_1.add(lblRegistration);
JPanel panel_2 = new JPanel();
regpanel.add(panel_2, BorderLayout.CENTER);
panel_2.setLayout(null);
JLabel lblUsername = new JLabel(Labels.REG_USERNAME);
lblUsername.setBounds(74, 92, 132, 16);
panel_2.add(lblUsername);
JLabel lblPassword = new JLabel(Labels.REG_PASSWORD);
lblPassword.setBounds(74, 149, 173, 16);
panel_2.add(lblPassword);
JLabel lblPasswordAgain = new JLabel(Labels.REG_RE_PASSWORD);
lblPasswordAgain.setBounds(74, 204, 173, 16);
panel_2.add(lblPasswordAgain);
txtUsername = new JTextField();
txtUsername.setBounds(252, 89, 380, 22);
panel_2.add(txtUsername);
txtUsername.setColumns(10);
txtPass1 = new JPasswordField();
txtPass1.setBounds(252, 146, 380, 22);
panel_2.add(txtPass1);
txtPass2 = new JPasswordField();
txtPass2.setBounds(252, 201, 380, 22);
txtPass1.addActionListener(gui.getController());
txtPass1.setActionCommand(Labels.REG_PASS1FIELD);
txtPass2.addActionListener(gui.getController());
txtPass2.setActionCommand(Labels.REG_PASS2FIELD);
txtUsername.addActionListener(gui.getController());
txtUsername.setActionCommand(Labels.REG_USERFIELD);
panel_2.add(txtPass2);
JButton btnRegistration = new JButton(Labels.REG_REGBUTTON);
btnRegistration.addActionListener(gui.getController());
btnRegistration.setBounds(278, 288, 151, 25);
panel_2.add(btnRegistration);
}
示例12: CollectionPanel
import javax.swing.JTextField; //导入方法依赖的package包/类
/**
* Create the panel.
*/
public CollectionPanel() {
setLayout(null);
collection = new ArrayList<String>();
txtSearch = new JTextField();
txtSearch.setToolTipText("Search...");
txtSearch.setBounds(208, 29, 278, 28);
add(txtSearch);
txtSearch.setColumns(100);
btnSearch = new JButton("Search");
btnSearch.setBounds(506, 30, 117, 29);
add(btnSearch);
JLabel lblSearch = new JLabel("Search:");
lblSearch.setFont(new Font("Lucida Grande", Font.PLAIN, 25));
lblSearch.setBounds(108, 23, 88, 31);
add(lblSearch);
btnCraft = new JButton("Craft");
btnCraft.setBounds(245, 266, 117, 29);
add(btnCraft);
btnDust = new JButton("Dust");
btnDust.setBounds(374, 266, 117, 29);
add(btnDust);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(23, 73, 646, 181);
add(scrollPane);
list = new JList<String>(collection_model);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
scrollPane.setViewportView(list);
btnBack = new JButton("Back");
btnBack.setBounds(22, 266, 117, 29);
add(btnBack);
lblDust = new JLabel("Dust:");
lblDust.setHorizontalAlignment(SwingConstants.TRAILING);
lblDust.setBounds(563, 271, 106, 16);
add(lblDust);
}
示例13: LoginPanel
import javax.swing.JTextField; //导入方法依赖的package包/类
/**
* Create the panel.
*/
public LoginPanel() {
JLabel lblNoConfigurationFound = new JLabel("No configuration found for logging in.");
lblNoConfigurationFound.setFont(new Font("PMingLiU", Font.BOLD, 12));
lblNoConfigurationFound.setForeground(Color.RED);
lblNoConfigurationFound.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblAnOsuAccount = new JLabel("An osu! account is required to download beatmaps.");
lblAnOsuAccount.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblYourLoginInformation = new JLabel(
"Your login information will only used for logging in to osu! forum.");
lblYourLoginInformation.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblSeeGithubProjects = new JLabel("See GitHub project's disclaimer for more details.");
lblSeeGithubProjects.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblUsername = new JLabel("Username:");
usrFld = new JTextField();
usrFld.setColumns(10);
JLabel lblPassword = new JLabel("Password:");
pwdFld = new JPasswordField();
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup().addContainerGap()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lblAnOsuAccount, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
.addComponent(lblNoConfigurationFound, GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
.addComponent(lblYourLoginInformation, GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE)
.addComponent(lblSeeGithubProjects, GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE)
.addGroup(groupLayout
.createSequentialGroup().addGroup(groupLayout
.createParallelGroup(Alignment.TRAILING, false)
.addComponent(lblPassword, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblUsername, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(pwdFld, GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
.addComponent(usrFld, GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE))))
.addContainerGap()));
groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(lblNoConfigurationFound)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(lblAnOsuAccount)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(lblYourLoginInformation)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(lblSeeGithubProjects)
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(lblUsername)
.addComponent(usrFld))
.addPreferredGap(ComponentPlacement.RELATED).addGroup(groupLayout
.createParallelGroup(Alignment.BASELINE).addComponent(lblPassword).addComponent(pwdFld))
.addGap(13)));
setLayout(groupLayout);
}
示例14: GestionRevistas
import javax.swing.JTextField; //导入方法依赖的package包/类
public GestionRevistas(Connection conn,JFrame principal) {
super();
this.conn=conn; // Recibimos la conexi�n de Biblioteca
this.principal=principal;
this.principal.setEnabled(false);
this.principal.setVisible(false);
setTitle("Gesti�n de revistas");
txtCodigo = new JTextField();
txtCodigo.setEditable(false);
txtCodigo.setHorizontalAlignment(SwingConstants.CENTER);
txtCodigo.setBounds(58, 67, 106, 20);
getContentPane().add(txtCodigo);
txtCodigo.setColumns(10);
txtSignatura = new JTextField();
txtSignatura.setEditable(false);
txtSignatura.setHorizontalAlignment(SwingConstants.CENTER);
txtSignatura.setBounds(222, 67, 106, 20);
getContentPane().add(txtSignatura);
txtSignatura.setColumns(10);
txtNombre = new JTextField();
txtNombre.setEditable(false);
txtNombre.setHorizontalAlignment(SwingConstants.CENTER);
txtNombre.setBounds(58, 136, 106, 20);
getContentPane().add(txtNombre);
txtNombre.setColumns(10);
txtMateria = new JTextField();
txtMateria.setEditable(false);
txtMateria.setHorizontalAlignment(SwingConstants.CENTER);
txtMateria.setBounds(222, 136, 106, 20);
getContentPane().add(txtMateria);
txtMateria.setColumns(10);
lblCodigo = new JLabel("Codigo");
lblCodigo.setHorizontalAlignment(SwingConstants.CENTER);
lblCodigo.setBounds(81, 42, 60, 14);
getContentPane().add(lblCodigo);
lblNombre = new JLabel("Nombre");
lblNombre.setHorizontalAlignment(SwingConstants.CENTER);
lblNombre.setBounds(245, 42, 60, 14);
getContentPane().add(lblNombre);
lblSignatura = new JLabel("Signatura");
lblSignatura.setHorizontalAlignment(SwingConstants.CENTER);
lblSignatura.setBounds(81, 111, 60, 14);
getContentPane().add(lblSignatura);
lblMateria = new JLabel("Materia");
lblMateria.setHorizontalAlignment(SwingConstants.CENTER);
lblMateria.setBounds(245, 111, 60, 14);
getContentPane().add(lblMateria);
lblGestinDeRevistas = new JLabel("Gesti\u00F3n de revistas");
lblGestinDeRevistas.setForeground(Color.BLUE);
lblGestinDeRevistas.setHorizontalAlignment(SwingConstants.CENTER);
lblGestinDeRevistas.setBounds(142, 11, 114, 14);
getContentPane().add(lblGestinDeRevistas);
}
示例15: GUI
import javax.swing.JTextField; //导入方法依赖的package包/类
/**
* Constructor que arma el GUI.
*/
public GUI(){
contenedor=getContentPane();
contenedor.setLayout(null);
/*Creamos el objeto*/
fileChooser=new JFileChooser();
/*Propiedades del Label, lo instanciamos, posicionamos y
* activamos los eventos*/
labelTitulo= new JLabel();
labelTitulo.setText("l Tribunal Supremo Electorial");
labelTitulo.setBounds(110, 20, 180, 23);
areaDeTexto = new JTextArea();
areaDeTexto.setEditable(false);
//para que el texto se ajuste al area
areaDeTexto.setLineWrap(true);
//permite que no queden palabras incompletas al hacer el salto de linea
areaDeTexto.setWrapStyleWord(true);
scrollPaneArea = new JScrollPane();
scrollPaneArea.setBounds(20, 50, 350, 270);
scrollPaneArea.setViewportView(areaDeTexto);
/*Propiedades del boton, lo instanciamos, posicionamos y
* activamos los eventos*/
botonAbrir= new JButton();
botonAbrir.setText("Boton 1");
botonAbrir.setBounds(474, 281, 91, 23);
botonAbrir.addActionListener(this);
/*Agregamos los componentes al Contenedor*/
contenedor.add(labelTitulo);
contenedor.add(scrollPaneArea);
contenedor.add(botonAbrir);
btnNewButton = new JButton("Boton 2");
btnNewButton.setBounds(620, 281, 89, 23);
getContentPane().add(btnNewButton);
btnNewButton.addActionListener(this);
JTextPane txtpnInstruccionesnBoton = new JTextPane();
txtpnInstruccionesnBoton.setEditable(false);
txtpnInstruccionesnBoton.setFont(new Font("Dialog", Font.PLAIN, 14));
txtpnInstruccionesnBoton.setBackground(SystemColor.control);
txtpnInstruccionesnBoton.setText("Instrucciones: \r\nCargar: Cargar datos guategrafo.txt\r\nBoton 1: Preguntar el nombre de la ciudad origen y ciudad destino.\r\nBoton 2: Modificar grafo");
txtpnInstruccionesnBoton.setBounds(440, 50, 269, 101);
getContentPane().add(txtpnInstruccionesnBoton);
txtNoHayArchivo = new JTextField();
txtNoHayArchivo.setEditable(false);
txtNoHayArchivo.setForeground(Color.RED);
txtNoHayArchivo.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 14));
txtNoHayArchivo.setText("No hay archivo cargado.");
txtNoHayArchivo.setBackground(Color.DARK_GRAY);
txtNoHayArchivo.setBounds(509, 190, 204, 34);
getContentPane().add(txtNoHayArchivo);
txtNoHayArchivo.setColumns(10);
btnCargar = new JButton("Cargar");
btnCargar.setBounds(410, 197, 89, 23);
getContentPane().add(btnCargar);
btnCargar.addActionListener(this);
//Asigna un titulo a la barra de titulo
setTitle("Proyecto");
//tama�o de la ventana
setSize(750,363);
//pone la ventana en el Centro de la pantalla
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}