Search code examples
javaeclipsenetbeansgui-builder

How to get Netbeans GUI Builder to not auto-generate fully qualified class names for components


how can i use shorter code like eclipse in netbeans while using GUI Builder? for example

Jbutton btnCalculate = new javax.swing.JButton();

is generated automatically but i want shorter code like in eclipse

Jbutton btnCalculate = new JButton();

While creating a button !


Solution

  • "how can i use shorter code like eclipse in netbeans while using swing designer? "

    1. Go to Tools -> Options
    2. Click Java Button
    3. Click GUI Builder tab
    4. De-select Generate Fully Qualified Name of Classes

    As you Drag and Drop components, imports will be added for you.

    Also, if you want to hand code a component that has not been imported yet, just hit Shift + Ctrl + I to resolve all imports.

    There is also a per-form option: select the root node in Inspector window and see Generate Full Classnames property in Properties window.