Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 693641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:46:29+00:00 2026-05-14T02:46:29+00:00

When creating a new project in netbeans, if i select JAVA Desktop application, it

  • 0

When creating a new project in netbeans, if i select JAVA Desktop application, it creates some code which I DO NOT RECOGNISE AT ALL as what i had learnt in swing.

It imports packages such as :

org.jdesktop.application.SingleFrameApplication;

also, the declaration for main() looks like this :

public static void main(String[] args) {
            launch(DesktopApplication2.class, args);
        }

This really does not make any sense to my knowledge of JFrame, JPanel etc..

If i try to code a netbeans application from scratch, i can write my own swing app BUT I CANNOT FIND THE GUI EDITOR.

  • How do i bring the GUI editor when creating java application from scratch ?
  • Can anyone explain to me this org.jdesktop.application.SingleFrameApplication and other classes ?

Please help. This is really frustrating.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:46:29+00:00Added an answer on May 14, 2026 at 2:46 am

    You may have inadvertently selected Java Desktop Application

    Creates a skeleton of a desktop application based on the Swing Application Framework (JSR 296). This template provides basic application infrastructure such as a menu bar, persisting of window state, and status bar. With this template, you can also generate code to create a GUI interface for a database table.

    Rather than Java Application

    Creates a new Java SE application in a standard IDE project. You can also generate a main class in the project. Standard projects use an IDE-generated Ant build script to build, run, and debug your project.

    Addendum: Use File > New File > Java GUI Forms to add high-level containers, e.g. an enclosing JPanel, that can be instantiated from main()‘s run() method.

    For example, Main.main():

    package temp;
    import java.awt.EventQueue;
    import javax.swing.JFrame;
    
    public class Main {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    JFrame f = new JFrame();
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    f.add(new NewJPanel());
                    f.pack();
                    f.setVisible(true);
                }
            });
        }
    }
    

    And a NewJPanel built in the GUI editor (note “Generated Code”):

    package temp;
    public class NewJPanel extends javax.swing.JPanel {
    
        /** Creates new form NewJPanel */
        public NewJPanel() {
            initComponents();
        }
    
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
    
            jLabel1 = new javax.swing.JLabel();
    
            jLabel1.setText("Hello, world!");
    
            org.jdesktop.layout.GroupLayout layout =
                new org.jdesktop.layout.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(163, 163, 163)
                    .add(jLabel1)
                    .addContainerGap(157, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(113, 113, 113)
                    .add(jLabel1)
                    .addContainerGap(171, Short.MAX_VALUE))
            );
        }// </editor-fold>
    
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        // End of variables declaration
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I'm creating new project with GWT plug in it creates a skeleton project
When creating a new Java project in IntelliJ IDEA, the following directories and files
When creating a new MVC Project in VS2008 Professional (SP1 installed), I do not
When creating a new project in Flash Builder, how does it determine which sdk
I have used BackButtonStyle which is created in StandardStyles.xaml (while creating new metro project).
When creating a new project for MVC3 I have an option to select a
Netbeans is creating a class Main automatically when I create a new project. so
While creating new Java project in Eclipse I got following warning The current workspace
I'm creating a new project in Netbeans 6.9, and it's asking me for a
when i am creating new android project from visual studio 2010 it gives the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.