basicJavaprogrammer
unread,May 4, 2008, 9:19:51 PM5/4/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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);