mausam
Posts: 243
Nickname: mausam
Registered: Sep, 2003
|
|
Re: Problem with text control
|
Posted: Dec 17, 2004 3:49 AM
|
|
private void jbInit() throws Exception
{
this.getContentPane().setLayout(null);
this.setSize(new Dimension(400, 300));
jTextArea1.setText("Test");
jTextArea1.setBounds(new Rectangle(40, 40, 225, 60));
jTextArea1.setForeground(Color.red);
jButton1.setText("jButton1");
jButton1.setBounds(new Rectangle(95, 175, 73, 22));
jButton1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
jButton1_actionPerformed(e);
}
});
this.getContentPane().add(jButton1, null);
this.getContentPane().add(jTextArea1, null);
}
private void jButton1_actionPerformed(ActionEvent e)
{
JOptionPane.showMessageDialog(null, jTextArea1.getText());
}
Its a part of code and it works fine...
|
|