Results 1 to 5 of 5
  1. #1
    naa
    naa is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Default New to Java. Need Help

    Java Code:
    package crawler;
    
     import java.awt.EventQueue;
    
     import javax.swing.JFrame;
     import javax.swing.JTextField;
     import java.awt.BorderLayout;
     import javax.swing.JLabel;
     import java.awt.GridBagLayout;
     import java.awt.FlowLayout;
     import java.awt.GridLayout;
     import java.awt.GridBagConstraints;
     import com.jgoodies.forms.layout.FormLayout;
     import com.jgoodies.forms.layout.ColumnSpec;
     import com.jgoodies.forms.layout.RowSpec;
     import com.jgoodies.forms.factories.FormFactory;
     import javax.swing.JButton;
     import javax.swing.JTextArea;
     import java.awt.event.ActionListener;
     import java.awt.event.ActionEvent;
     import java.io.IOException;
     import java.util.Hashtable;
     import java.util.Enumeration;
    
     public class MainWindow extends WebCrawler {
    
     /**
     * @uml.property name="frame"
     * @uml.associationEnd multiplicity="(1 1)"
     */
     private JFrame frame;
     /**
     * @uml.property name="textField"
     * @uml.associationEnd multiplicity="(1 1)"
     */
     private JTextField textField;
     /**
     * @uml.property name="textField_1"
     * @uml.associationEnd multiplicity="(1 1)"
     */
     private JTextField textField_1;
     /**
     * @uml.property name="btnStartSearch"
     * @uml.associationEnd multiplicity="(1 1)"
     */
     private JButton btnStartSearch;
     /**
     * @uml.property name="textArea"
     * @uml.associationEnd multiplicity="(1 1)"
     */
     private JTextArea textArea;
    
     /**
     * Launch the application.
     */
     public static void main(String[] args) {
     EventQueue.invokeLater(new Runnable() {
     public void run() {
     try {
     MainWindow window = new MainWindow();
     window.frame.setVisible(true);
     } catch (Exception e) {
     e.printStackTrace();
     }
     }
     });
     }
    
     /**
     * Create the application.
     */
     public MainWindow() {
     initialize();
     }
    
     /**
     * Initialize the contents of the frame.
     */
     private void initialize() {
     frame = new JFrame();
     frame.setBounds(100, 100, 450, 416);
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
     frame.getContentPane().setLayout(new FormLayout(new ColumnSpec[] {
     FormFactory.RELATED_GAP_COLSPEC,
     FormFactory.DEFAULT_COLSPEC,
     FormFactory.RELATED_GAP_COLSPEC,
     ColumnSpec.decode("default:grow"),},
     new RowSpec[] {
     FormFactory.RELATED_GAP_ROWSPEC,
     FormFactory.DEFAULT_ROWSPEC,
     FormFactory.RELATED_GAP_ROWSPEC,
     FormFactory.DEFAULT_ROWSPEC,
     FormFactory.RELATED_GAP_ROWSPEC,
     FormFactory.DEFAULT_ROWSPEC,
     FormFactory.RELATED_GAP_ROWSPEC,
     FormFactory.DEFAULT_ROWSPEC,
     FormFactory.RELATED_GAP_ROWSPEC,
     FormFactory.DEFAULT_ROWSPEC,
     FormFactory.RELATED_GAP_ROWSPEC,
     RowSpec.decode("default:grow"),}));
    
     JLabel lblNewLabel = new JLabel("Web Seed Address");
     frame.getContentPane().add(lblNewLabel, "2, 6, right, default");
    
     textField = new JTextField();
     frame.getContentPane().add(textField, "4, 6, fill, default");
     textField.setColumns(10);
    
     JLabel lblNewLabel_1 = new JLabel("Search Terms");
     frame.getContentPane().add(lblNewLabel_1, "2, 8, right, default");
    
     textField_1 = new JTextField();
     frame.getContentPane().add(textField_1, "4, 8, fill, default");
     textField_1.setColumns(10);
    
     }
     }
    Last edited by JosAH; 04-23-2013 at 05:02 PM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default Re: New to Java. Need Help

    Um...and the error is?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    naa
    naa is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Default Re: New to Java. Need Help

    the error that it gives is

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at crawler.MainWindow.main(MainWindow.java:56)

    and its got a red cross beside

    ColumnSpec.decode("default:grow"),},
    and
    RowSpec.decode("default:grow"),}));

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default Re: New to Java. Need Help

    And the text for the red cross (or the red underline in the code) will tell you what's wrong.

    No point trying to execute code that hasn't actually compiled yet.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,679
    Blog Entries
    7
    Rep Power
    21

    Default Re: New to Java. Need Help

    @op: I reinstalled your orignal text; changing it to 'qqqqqqq' leaves the entire thread useless; don't do it anymore.

    kind regards,

    Jos

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •