View Single Post
  #5 (permalink)  
Old 06-03-2008, 10:01 PM
kewlgeye kewlgeye is offline
Member
 
Join Date: Apr 2008
Posts: 34
kewlgeye is on a distinguished road
Ok I put this code in the jbutton section and I kept receiving an error that said "Illegal start of expression" I don't know enough to see anything wrong with this. Netbeans didn't say anything else.

Code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { //invoke this when add button fired private static final void addList(){ dlm.addElement((Object)jTextField1); // add name dlm.addElement((Object)jTextField2); // add lastname } }
and this code I put at the very top of the code, their is more like the rest of the GUI, but I didn't paste it because its too long.


Code:
package editor; import javax.swing.JList; import javax.swing.*; /** * * @author Philip */ class MyMainClass{ DefaultListModel dlm = new DefaultListModel(); JList jlist = new JList( dlm ); } public class NewJFrame extends javax.swing.JFrame { /** Creates new form NewJFrame */ public NewJFrame() { initComponents(); }
Reply With Quote