Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Problem in import com. in eclipse

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem in import com. in eclipse

    Hi .
    I have a problem in my program that i have coded in eclipse bye jigloo.
    i create some forms in jigloo in a computer and then i copied the code generated by jigloo and then i pasted it in a class in my laptop in eclipse,but now there are some errros in code!!
    the program gives errors for this line :
    import com.cloudgarden.layout.AnchorConstraint;
    import com.cloudgarden.layout.AnchorLayout;
    it seems doesnt recognize this!
    please help in it,wats wrong with it?jigloo has generated this codebut now...
    Waiting for ur helps!!!


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Please Helppp!!....(problem in import com.)

    what does the rest of your code look like? can you copy/paste the exact error message?

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Location
    Bangalore.India
    Posts
    9
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: Please Helppp!!....(problem in import com.)

    Import appropriate jar file in to your eclipse java build path libraries

  4. #4
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Please Helppp!!....(problem in import com.)

    my code is :

    package UserForm;
    import com.cloudgarden.layout.AnchorConstraint;
    import com.cloudgarden.layout.AnchorLayout;
    import java.awt.event.MouseAdapter;
    import javax.swing.ComboBoxModel;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JLabel;
    import javax.swing.JPasswordField;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JToggleButton;
     
    import javax.swing.WindowConstants;
    import javax.swing.SwingUtilities;
    public class UserForm extends javax.swing.JFrame {
        private JTextField username;
        private JLabel UserType;
        private JPasswordField pass;
        private JComboBox jComboBox1;
        private JButton Register;
        private JLabel welocmeNote;
        private JLabel password;
        private JButton Enter;
        private JLabel jLabel1;
     
        /**
        * Auto-generated main method to display this JFrame
        */
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    UserForm inst = new UserForm();
                    inst.setLocationRelativeTo(null);
                    inst.setVisible(true);
                }
            });
        }
     
        public UserForm() {
            super();
            initGUI();
        }
     
        private void initGUI() {
            try {
                setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                getContentPane().setLayout(null);
                this.setTitle("\u0635\u0641\u062d\u0647 \u0648\u0631\u0648\u062f");
                {
                    username = new JTextField();
                    getContentPane().add(username, new AnchorConstraint(188, 370, 248, 185, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
                    username.setBounds(181, 87, 126, 22);
                }
                {
                    jLabel1 = new JLabel();
                    getContentPane().add(jLabel1, new AnchorConstraint(196, 540, 240, 401, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
                    jLabel1.setText("\u0634\u0646\u0627\u0633\u0647 \u06a9\u0627\u0631\u0628\u0631\u06cc");
                    jLabel1.setFont(new java.awt.Font("Tahoma",1,12));
                    jLabel1.setBounds(380, 90, 117, 17);
                }
                {
                    Enter = new JButton();
                    getContentPane().add(Enter, new AnchorConstraint(572, 466, 633, 315, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
                    Enter.setText("\u0648\u0631\u0648\u062f");
                    Enter.setFont(new java.awt.Font("Tahoma",1,12));
                    Enter.setBounds(239, 248, 93, 22);
                }
                {
                    password = new JLabel();
                    getContentPane().add(password, new AnchorConstraint(366, 540, 410, 403, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
                    password.setText("\u0631\u0645\u0632 \u0639\u0628\u0648\u0631");
                    password.setFont(new java.awt.Font("Tahoma",1,12));
                    password.setBounds(417, 135, 80, 16);
                }
                {
                    welocmeNote = new JLabel();
                    getContentPane().add(welocmeNote);
                    welocmeNote.setText("\u0628\u0647 \u0633\u06cc\u0633\u062a\u0645 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u062e\u0648\u0634 \u0622\u0645\u062f\u06cc\u062f");
                    welocmeNote.setBounds(150, 27, 290, 16);
                    welocmeNote.setFont(new java.awt.Font("Tahoma",1,14));
                }
                {
                    Register = new JButton();
                    getContentPane().add(Register);
                    Register.setText("\u0627\u0646\u0635\u0631\u0627\u0641");
                    Register.setBounds(107, 248, 93, 22);
                    Register.setFont(new java.awt.Font("Tahoma",1,12));
                    Register.addMouseListener(new MouseAdapter() {
                    });
                }
                {
                    UserType = new JLabel();
                    getContentPane().add(UserType);
                    UserType.setText("\u0646\u0648\u0639 \u06a9\u0627\u0631\u0628\u0631");
                    UserType.setBounds(417, 186, 80, 19);
                    UserType.setFont(new java.awt.Font("Tahoma",1,12));
                }
                {
                    ComboBoxModel jComboBox1Model = 
                        new DefaultComboBoxModel(
                                new String[] { "\u0639\u0627\u062f\u06cc", "\u0645\u062f\u06cc\u0631","\u0637\u0631\u0627\u062d"});
                    jComboBox1 = new JComboBox();
                    getContentPane().add(jComboBox1);
                    jComboBox1.setModel(jComboBox1Model);
                    jComboBox1.setBounds(181, 183, 127, 22);
                    jComboBox1.setFont(new java.awt.Font("Tahoma",1,12));
     
                }
                {
                    pass = new JPasswordField();
                    getContentPane().add(pass);
                    pass.setBounds(181, 132, 127, 22);
                }
                pack();
                this.setSize(600, 400);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    it says:
    the import can not resolved
    the AnchorConstraint can not be resolved to a type
    i dont know why it doesnt underestand this import!
    because this code is generated by jigloo on another computer and should be correct!
    wat jar file should i add to build path??
    please explain it in detail!
    Thanks so much for yor helps!

  5. #5
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: Please Helppp!!....(problem in import com.)

    some package does not exist .. i think..... i pasted it too in my IDE and the system is looking for the
    AnchorConstraint class and the com.cloudgarden package

  6. #6
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Please Helppp!!....(problem in import com.)

    I found the solution!
    I think its related to a package in jigloo that java here can not recognize!i delete import parts in begin of the code and the new acchorconstraint from code and it is correct now!!!it works good!!
    u can try it too in your IDEA !
    thanks all!

  7. #7
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Please Helppp!!....(problem in import com.)

    I found the solution!
    I think its related to a package in jigloo that java here can not recognize!i delete import parts in begin of the code and the new acchorconstraint from code and it is correct now!!!it works good!!
    u can try it too in your IDEA !
    thanks all!

Similar Threads

  1. How to import an .tiff image in JSP?
    By jazz2k8 in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: May 12th, 2008, 05:55 AM