Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25
  1. #21
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by johny2011 View Post
    Yes, I already put them inside JARS directory, but not worked.

    Another question before I ask,

    All examples around oracle and sites deal with directlcy compiling with java and jaavc, from command prompt.

    Right now I am using Ecilpse,in the early days I was also using command prompt while writing with java, but I wonder how many people today out there still compiling their projects with these javac, jar etc. commands directly from command prompt ?

    Is is possible to carry big project with command prompt compiling ??

    And also, Is it possible to continue compile a project from command prompt which is before written and developed in Eclipse IDE. I am confused about this points.
    My project has many classess files etc, how can compile it from console ?
    It doesn't matter if you compile/pack the stuff with javac and jar directly or through the Eclipse built-in tools. May I suggest you start off small; write a few toy classes and stick them in different .jar files. Try to run the 'main' class and see if it works; the way it is going now it is going nowhere: you keep on claiming that "t doesn't work" and we can just guess what you have been doing. Obviously it doesn't do what you want it to do, otherwise you wouldn't be here but we can't help you any further without knowing the details of your classes and what you actually did to stick them in a .jar file.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  2. #22
    johny2011 is offline Member
    Join Date
    Apr 2011
    Posts
    28
    Rep Power
    0

    Default

    Thank you, I finaly solve my JAR problems.
    I am exporting with JARS filees to another directory options within Java,
    and dont include other files in JAR file because it doesnt matter.

    One thing I dont understand is that, when I make a JAR file , a lot of instances of my classes produced

    for example for my graphical user interface, there up to 60 !

    GUI1$60 -> GUI$60.class

    That means this class re-created a new instance 60 times total in my project ?

    Well, size is not important, I mean every one of them is 1 kb, but I think that is too much, there must be soe problem somewhere in my code..

    I just wonder this whether this number is normal or not.

    What you advanced guys do for it (for this kind of classes, user interface etc.)

    what are the best practices there?

  3. #23
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by johny2011 View Post
    Thank you, I finaly solve my JAR problems.
    I am exporting with JARS filees to another directory options within Java,
    and dont include other files in JAR file because it doesnt matter.

    One thing I dont understand is that, when I make a JAR file , a lot of instances of my classes produced

    for example for my graphical user interface, there up to 60 !

    GUI1$60 -> GUI$60.class

    That means this class re-created a new instance 60 times total in my project ?

    Well, size is not important, I mean every one of them is 1 kb, but I think that is too much, there must be soe problem somewhere in my code..

    I just wonder this whether this number is normal or not.

    What you advanced guys do for it (for this kind of classes, user interface etc.)

    what are the best practices there?
    The GUI$60.class file is a compiled anonymous (inner) class. Most likely it's a listener class (ActionListener etc.). Because you didn't give it a name, the compiler did it for you. 60 anonymous classes is quite a lot of classes; your outer class is some sort of 'god class', i.e. it does it all.

    kind regards,

    Jos
    Last edited by JosAH; 05-02-2011 at 04:05 PM.
    cenosillicaphobia: the fear for an empty beer glass

  4. #24
    johny2011 is offline Member
    Join Date
    Apr 2011
    Posts
    28
    Rep Power
    0

    Default

    So, how can I give a name to a listener class ?

    Another questions, how you advanced guys handle GUI functions ?

    For example, I use swing and put my GUI related methods into GUI class
    But still it seems to me everythin is not suitable.

    what is the best practices out there ? How big programs handle GUI ?

    Put it another JAR (but il uses swing library not my generated classes)
    or put it different files, if so how ?

    Thanks.

  5. #25
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by johny2011 View Post
    So, how can I give a name to a listener class ?

    Another questions, how you advanced guys handle GUI functions ?

    For example, I use swing and put my GUI related methods into GUI class
    But still it seems to me everythin is not suitable.

    what is the best practices out there ? How big programs handle GUI ?

    Put it another JAR (but il uses swing library not my generated classes)
    or put it different files, if so how ?

    Thanks.
    There's nothing wrong with an anonymouse class, why do you want to give it a name? I only makes your code (a bit) longer ... w.r.t. your 'GUI program': keep your 'business logic' separate from your GUI stuff. Your 'business logic' should be full of Listeners where the 'intelligence' is. Your GUI should just display stuff, it should be too stupid to do anything else.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Creating Jar Files with functioning input files
    By appleLove in forum NetBeans
    Replies: 1
    Last Post: 04-10-2011, 10:37 PM
  2. How to get Jar files to work with Databases
    By hunterbdb in forum JDBC
    Replies: 14
    Last Post: 01-12-2011, 07:45 PM
  3. Replies: 8
    Last Post: 07-30-2010, 05:47 PM
  4. Replies: 6
    Last Post: 02-06-2009, 08:05 PM
  5. Behaving text files like binary files
    By Farzaneh in forum New To Java
    Replies: 2
    Last Post: 08-27-2008, 03:20 PM

Posting Permissions

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