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.

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 61

Thread: Scroll down in JOptionPane and window problems.

  1. #26
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Go to the folder with the class files and use the java command.

    Read up on how to put an application into a jar file. Then others will be able to use it.

  2. #27
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Not the code. Turn it into a program.

    Look. Guy gets paid to design software. Boss is not going to be happy if, on deadline day, he only has it in JGrasp and not as a program customers can use.

    Now get what I'm asking?

    You don't study to write programs that'll only work in JGrasp. You study it to write programs so you can make them into programs that'll run as computer applications, like video games. How do you use the code to make it run outside of the code maker program as a program of its own?

    Is it complicated or something?

    I'm looking for a make into program button in JGrasp, but can't find one.

  3. #28
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Class files are not source code. They are executable.

    Read up on how to put an application into a jar file. Then others will be able to use it.

  4. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 14th, 2010)

  5. #29
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    You mean as code or to play it if it is a game?

  6. #30
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    I'm not talking about making it so others can use my code, well, I am but I'm not. In other words, let's say I used JGrasp to make a calculator. How do I get that calculator to run outside of JGrasp? i.e. the dudes who made Windows Calculator, how'd they get it as a separate application? I'm not asking how to make a calculator, just how to make software into software the users would normally see. I mean, where my code isn't showing in the background to the user.

  7. #31
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Put the class files in a jar file that includes a manifest file.

  8. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 14th, 2010)

  9. #32
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Cool Re: Scroll down in JOptionPane and window problems.

    What?

    What's a jar file and a manifest file?

    I've gotten jar files before. However, I don't know how to put anything in one. I have no clue what either really is.

  10. #33
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Scroll down in JOptionPane and window problems.


  11. The Following User Says Thank You to copeg For This Useful Post:

    javapenguin (June 14th, 2010)

  12. #34
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    What's a command prompt?

  13. #35
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Might normally be able to figure it out on my own, but am pretty tired right now.

    Actually, I just don't quite know what it is, though I am tired, which isn't helping any.

  14. #36
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Never mind, I found it.

    So am I just creating a zip drive or software by doing this?

  15. #37
    Member
    Join Date
    May 2010
    Posts
    38
    Thanks
    1
    Thanked 8 Times in 7 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Surly the IDE you should be using does this for you? Creating a jar file by hand with command prompt leads to a ugly huge mass of switches and semicolon separated arguments.

    If your not using an IDE, then its time to get acquainted with ant: Apache Ant - Welcome

  16. #38
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Quote Originally Posted by Norm View Post
    this jumping around is leaving lots of holes where you should have knowledge.
    Go back to chapter one and start over.
    Seconded.

    db

  17. #39
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Do I have to have all of the handlers and exception classes that it uses all on there? I have them all on a flash drive. However, I have a big class file that s really big, and I'm wondering if it already contains all the button handlers and exception classes in it. If not, what do I do? How do I put it in the manifest file? I mean, do I put it as main, or what?

  18. #40
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    You need to put everything that is needed in the jar file.

    How do I put it in the manifest file
    Read the doc on how to use the jar command.

  19. #41
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Wait, do I need a manifest file before I made the jar file, or is that not a good idea?

    I don't know how to make a jar without one.

  20. #42
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    the manifest file goes in the jar file.

  21. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 15th, 2010)

  22. #43
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    So how do I make a jar file?

    It won't let me.

    It says, access denied.

  23. #44
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Do i call the file Main-Class in the manifest file? I told it to make a manifest file and then create a jar file like this:

    C:\"Program Files"\Java\jdk1.6.0_18\bin\jar cvfm battleshipGUICompiled.jar manifest.txt BattleshipGUI.class

    I have a file called manifest.text, but the command prompt claims it can't find it.
    Last edited by javapenguin; June 15th, 2010 at 12:00 PM.

  24. #45
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    When making the Jar file, do I need to save the class or the java files?

    I mean, program.java or program.class?

    Also, do I need to save all of my button handlers and exception classes used in program in the jar too, or can I use the big class file that probably contains all of that?

    Also, as these programs are on a flash drive, including the exception classes, and the jar file is on the hard drive, will it always not work then until I copy all to the hard drive first?

    When I save it, do I save it as something.jar or something.exe ?
    Last edited by javapenguin; June 15th, 2010 at 12:44 PM.

  25. #46
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Sounds like you need to read the Tutorial and the API doc about jar files.

  26. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 15th, 2010)

  27. #47
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    what do I do about this problem?

    The 'e' flag (for 'entrypoint'), introduced in JDK 6, creates or overrides the manifest's Main-Class attribute. It can be used while creating or updating a jar file. Use it to specify the application entry point without editing or creating the manifest file.

    Also, should the package name be the name of the class or something different, or does it not matter if it is or not?
    Last edited by javapenguin; June 15th, 2010 at 01:53 PM.

  28. #48
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    Main-Class: MyPackage.MyClass

    Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

    We then create a JAR file named MyJar.jar by entering the following command:

    jar cfm MyJar.jar Manifest.txt MyPackage/*.class

    What is MyPackage supposed to be called?

  29. #49
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    What is MyPackage supposed to be called
    You need to read about using packages when creating a program. Read about the package statement.

  30. #50
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Scroll down in JOptionPane and window problems.

    I thought a package would be something like:

    java.util

    or

    java.awt

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Using Icons in JOptionPane
    By Jchang504 in forum AWT / Java Swing
    Replies: 3
    Last Post: September 19th, 2014, 02:28 PM
  2. Return result from JOptionPane to JFrame
    By cselic in forum AWT / Java Swing
    Replies: 7
    Last Post: May 13th, 2010, 01:17 PM
  3. How do i show all the values in one window(JOptionPane)??
    By Antonioj1015 in forum AWT / Java Swing
    Replies: 1
    Last Post: November 25th, 2009, 09:24 PM
  4. JOptionPane Question/ Printing
    By 03EVOAWD in forum AWT / Java Swing
    Replies: 2
    Last Post: August 31st, 2009, 09:17 AM
  5. Replies: 1
    Last Post: May 21st, 2009, 03:41 AM