JText Area/JTextField HELP PLEASE

0 views
Skip to first unread message

basicJavaprogrammer

unread,
May 4, 2008, 9:19:51 PM5/4/08
to ActionScript User Interface Development
I have problem I can seem to fix. I have a Java program I am working
with that is linked to a Access database that I can not edit and save.
In my program I can get the textarea box to appear in front of the
panel but I can not get it to post in Access as text. It post as a
value like "-1". In the Access design, the comments field is set as
memo, but I cant change it to text. What can I do. I need help
asap... :(
Here is my code. What can I add to make the text box post as text
instead of value.



private JTextArea areaforcommentsJTextArea;
private JPanel areaforcommentsJPanel;
private JLabel areaforcommentsJLabel;

areaforcommentsJPanel = new JPanel();
areaforcommentsJPanel.setBounds( 40, 375, 276, 150);

areaforcommentsJPanel.setBorder( BorderFactory.createEtchedBorder() );
areaforcommentsJPanel.setBackground(Color.white);
areaforcommentsJPanel.setLayout( null );
contentPane.add( areaforcommentsJPanel );

areaforcommentsJLabel = new JLabel();
areaforcommentsJLabel.setBounds( 10, 15, 270, 20 );
areaforcommentsJLabel.setText( "Comments" );
areaforcommentsJPanel.add( areaforcommentsJLabel );

areaforcommentsJTextArea = new JTextArea();
areaforcommentsJTextArea.setBounds( 10, 40, 250, 70 );
areaforcommentsJTextArea.setText(
"Enter info here" );
areaforcommentsJTextArea.setBackground(Color.pink);
areaforcommentsJTextArea.setBorder(
BorderFactory.createLoweredBevelBorder() );
areaforcommentsJTextArea.setEditable( true );
areaforcommentsJPanel.add( areaforcommentsJTextArea );
private void updateInstructor()
{
comments = areaforcommentsJTextArea.getText();
}
String areaforcomments = "UPDATE InstEval" + " SET comments = " +
comments + " WHERE " +
"lastname = '" + lname + "'" + "and course = '"
+ courseName + "'";
myStatement.executeUpdate(areaforcomments);

Skitsanos

unread,
May 5, 2008, 2:48:07 AM5/5/08
to ActionScript User Interface Development
Dude, how do you think your post related to ActionScript?

Reply all
Reply to author
Forward
0 new messages