Custom Method as jTextArea Text?
Barry_C <[email protected]> Fri, 30 May 2008 11:23:07 -0700 (PDT)
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
I want my jTextArea text to be the value returned from a class method.
I have the following class:
/***********************************/
public class Appointment {
//Fields
private String note;
//Constructors
public Appointment() {
note = "This is what you get.";
}
//Methods
public String getNote() {
return note;
}
public void setNote(String anyName) {
this.note = anyName;
}
/****************************************/
Then my jTextarea code looks something like this:
/****************************************/
import com.miginfocom.beandemo.Appointment;
public class ApptDetails extends javax.swing.JDialog {
/** Creates new form ApptDetails */
public ApptDetails(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
private void initComponents() {
jTextArea1 = new javax.swing.JTextArea();
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jTextArea1.setText(getNote());
jScrollPane1.setViewportView(jTextArea1);
}
/*******************************************/
It yacks on the call to getNote(). What is the proper syntax for this?
--
View this message in context: http://www.nabble.com/Custom-Method-as-jTextArea-Text--tp17565311p17565311.html
Sent from the Netbeans - UI mailing list archive at Nabble.com.