Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2010
    Posts
    18
    Rep Power
    0

    Exclamation how to connect two classes

    i want to make a simple dic
    so i made a GUI
    j panal from netbeans

    and i want to connect that class into main method
    i do i do it


    i did like this it didnt work

    import class1.java

    in the main method

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: how to connect two classes

    Quote Originally Posted by vibaviattigala View Post
    i want to make a simple dic
    so i made a GUI
    j panal from netbeans

    and i want to connect that class into main method
    i do i do it


    i did like this it didnt work

    import class1.java

    in the main method
    I don't think that this current post is giving us near enough information to allow us to be able to help you.

    One suggestion though: since you are obviously new to Swing, don't use NetBean's code-generation tool for creating GUI's until you're much more familiar with Swing. It is easy to use for creating simple basic GUI's, but it is a bear if you want to make anything even moderately complex if you don't understand Swing first. Check out the Swing tutorials as they will explain all you need to know. You can find them here: Lesson: Using Swing Components

  3. #3
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    8

    Default Re: how to connect two classes

    You don't import .java file, import the class name instead. Your cannot not importing classes in the middle of a method, it should be defined before the class declaration. And also there is no such class called j panal in Java Swing.

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

    Default Re: how to connect two classes

    Oops, there are maggots crawling out of this dead thread ...

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Association Classes for these classes
    By kevinkhan in forum New To Java
    Replies: 9
    Last Post: 03-21-2012, 05:22 PM
  2. Classes Help!!! two classes with object question.
    By stuckonjava in forum New To Java
    Replies: 16
    Last Post: 02-10-2012, 01:39 AM
  3. Use classes inside of other classes
    By BlankFile in forum New To Java
    Replies: 2
    Last Post: 02-06-2012, 01:51 PM
  4. connect through usb
    By taufiqbzz in forum Networking
    Replies: 0
    Last Post: 11-01-2010, 11:04 PM
  5. Replies: 1
    Last Post: 02-10-2010, 12:55 AM

Posting Permissions

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