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 6 of 6

Thread: Creating a Java Desktop Application in NetBeans

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Creating a Java Desktop Application in NetBeans

    Sorry, I'm fairly new with Java. I created a new project in NetBeans by selecting New Project --> Java Desktop Application. This is what NetBeans produced for me:


    My goal is to display a series of menus which the user can select and input values to receive an end value. So I made the code for it and implemented GUI codes, and everything seems to work fine within NetBeans. Except, when I go to run the program, this is what happens:


    Both the GUI window shows up and the desktop application window.

    (1) How do I get what I have in the GUI window to appear in the desktop application window?

    (2) How do I get the application to show up on my desktop?

    (3) Also, how can I get that application onto other desktops?


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,163
    My Mood
    Hungover
    Thanks
    141
    Thanked 595 Times in 510 Posts

    Default Re: Creating a Java Desktop Application in NetBeans

    Step 1- Stop using the GUI builder.
    Step 2- Check out the Swing tutorials: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    Step 3- Add you gui to a JPanel inside the main JFrame (if that makes no sense, see step 2).
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member
    Join Date
    Sep 2011
    Posts
    32
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Creating a Java Desktop Application in NetBeans

    Hi cslx99,

    As Kevin has suggested. If you are fairly new to Java, you should not use a GUI builder like NetBeans at the first place. An IDE could help a lot for the beginners, as it does many things under the hood, you never know the details, how and why it is this and it isn't that... You will become lack of fundamental knowledge quickly and make yourself depends on the IDE.

    So you should learn to read the Tutorial and code examples by a simple text editor to familiarize yourself with the basics.

    For experienced codes, they cannot live without an IDE because it helps them to be more productivity.

    java memory
    Last edited by namhm; December 4th, 2011 at 05:50 PM.

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Creating a Java Desktop Application in NetBeans

    I'm not sure what you mean by GUI builder but I hard coded everything. The screen in the picture is what popped up after I ran the code.

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,163
    My Mood
    Hungover
    Thanks
    141
    Thanked 595 Times in 510 Posts

    Default Re: Creating a Java Desktop Application in NetBeans

    Quote Originally Posted by cslx99 View Post
    I'm not sure what you mean by GUI builder but I hard coded everything. The screen in the picture is what popped up after I ran the code.
    Netbeans comes with a GUI builder where you can drag-and-drop controls onto a frame. Usually, it causes more trouble than its worth for new programmers, and it makes it really hard to help people. I see the gui builder in your background, so I assumed you were using it.

    But if you coded it by hand, I'd recommend throwing together an SSCCE that demonstrates the problem, and we'll be happy to help you.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Junior Member
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Creating a Java Desktop Application in NetBeans

    The photo is unavailable maybe caused by the path you "called" the image? Check your path.

Similar Threads

  1. Updatable Java Desktop Application
    By Onur in forum Java Theory & Questions
    Replies: 3
    Last Post: September 18th, 2011, 03:15 PM
  2. Netbean Desktop Application Help!!
    By flyto9 in forum Java Theory & Questions
    Replies: 2
    Last Post: June 30th, 2011, 05:52 PM
  3. Remote Desktop Application
    By Drango in forum Java ME (Mobile Edition)
    Replies: 3
    Last Post: January 24th, 2011, 07:01 AM
  4. Replies: 0
    Last Post: December 3rd, 2009, 03:43 PM
  5. SQLite and Desktop Application
    By urosz in forum JDBC & Databases
    Replies: 12
    Last Post: November 2nd, 2009, 02:50 AM