negora | 21 Oct 12:12 2014

Disabling and enabling "Compiling on Save" doesn't work.

Hello:

For a long time I've been suffering a problem with many versions of NetBeans IDE, but today I've decided to
ask about it because I can't stand it any more.

Whenever I disable the feature "Compiling -> Compiling on Save", it seems to be impossible to re-enable it.
Apparently it autocompiles again. When you save a class file the IDE even shows the icon that denotes that
the class file has been compiled. However, it isn't being compiled at all. Doing a md5sum or a sha1sum shows
the same hash.

In application, library and Web projects it behaves like that. In EJB projects the effect it's the same but
the IDE doesn't mark the file as compiled.

My question is: Is it a bug? Or Am I missing something?

Thank you.

tonico | 20 Oct 18:44 2014
Picon

Re-using existing platform

I am a Noob at Linux, JAVA.  I am using Netbeans8 on Win7 to create RasberryPi GUI.
I have created the usual "Hello World" and have it run on the rPI.
The question is after you create a new platform in Netbeans pointing at the rPI is it possible to reuse that
same platform with new subsequent projects or do you have to create a new platform for every new project?
TIA
Tony

cjriii | 20 Oct 17:20 2014

Versioning settings unresponsive

Hi there,

With Netbeans 7.4 on Windows 7, the settings under Tools > Misc > Versioning is unresponsive. It can take
between 4-10 minutes to switch between any options. (All other settings are responsive as expected.)

Clicking cancel / the standard windows close button doesn't close the window either.

Is this a known bug? I couldn't find anything from Google or the forums (sometimes the search terms conflict
with popular terms.)

Any help is appreciated; thank you.

Picon

issue on the online tutorial

package org.yourorg.usermanagement;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;

<at> OptionsPanelController.SubRegistration(
        displayName = "#AdvancedOption_DisplayName_UserManagement",
        keywords = "#AdvancedOption_Keywords_UserManagement",
        keywordsCategory = "Advanced/UserManagement"
)
<at> org.openide.util.NbBundle.Messages({"AdvancedOption_DisplayName_UserManagement=User Management", "AdvancedOption_Keywords_UserManagement=Tool to manage username and password."})
public final class UserManagementOptionsPanelController extends OptionsPanelController {

    private UserManagementPanel panel;
    private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
    private boolean changed;

    public void update() {
        getPanel().load();
        changed = false;
    }

    public void applyChanges() {
        SwingUtilities.invokeLater(new Runnable() {
            <at> Override
            public void run() {
                getPanel().store();
                changed = false;
            }
        });
    }

    public void cancel() {
        // need not do anything special, if no changes have been persisted yet
    }

    public boolean isValid() {
        return getPanel().valid();
    }

    public boolean isChanged() {
        return changed;
    }

    public HelpCtx getHelpCtx() {
        return null; // new HelpCtx("...ID") if you have a help set
    }

    public JComponent getComponent(Lookup masterLookup) {
        return getPanel();
    }

    public void addPropertyChangeListener(PropertyChangeListener l) {
        pcs.addPropertyChangeListener(l);
    }

    public void removePropertyChangeListener(PropertyChangeListener l) {
        pcs.removePropertyChangeListener(l);
    }

    private UserManagementPanel getPanel() {
        if (panel == null) {
            panel = new UserManagementPanel(this);
        }
        return panel;
    }

    void changed() {
        if (!changed) {
            changed = true;
            pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
        }
        pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
    }

}






package org.yourorghere.login;

public class LoginFrame extends javax.swing.JPanel {

  
    public LoginFrame() {
        initComponents();
    }

   
    <at> SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        user = new javax.swing.JTextField();
        pass = new javax.swing.JPasswordField();

        jLabel1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(LoginFrame.class, "LoginFrame.jLabel1.text")); // NOI18N

        jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(LoginFrame.class, "LoginFrame.jLabel2.text")); // NOI18N

        user.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        user.setText(org.openide.util.NbBundle.getMessage(LoginFrame.class, "LoginFrame.user.text")); // NOI18N

        pass.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        pass.setText(org.openide.util.NbBundle.getMessage(LoginFrame.class, "LoginFrame.pass.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(user, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pass)))
                .addContainerGap(23, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(60, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {pass, user});

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel1, jLabel2});

    }// </editor-fold>                       
        public String getUsername(){
      return this.user.getText();
   }
   
   public char[] getPassword(){
      return this.pass.getPassword();
   }

    // Variables declaration - do not modify                    
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPasswordField pass;
    private javax.swing.JTextField user;
    // End of variables declaration                  
}





package org.yourorghere.login;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.swing.JButton;
import org.openide.DialogDisplayer;
import org.openide.LifecycleManager;
import org.openide.NotifyDescriptor;
import org.openide.modules.ModuleInstall;
import org.openide.util.Exceptions;
import org.openide.util.NbPreferences;
import org.yourorghere.usermanagement.UsermanagementPanel;

public class Installer extends ModuleInstall {
private LoginForm form = new LoginForm();
   <at> Override
   public void restored() {
      createLoginDialog();

   }
   
   private void createLoginDialog(){
    JButton ok = new JButton();
   ok.setText("OK");
  
   JButton cancel = new JButton();
   cancel.setText("Cancel");

   cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        exit();
      }
   });

   ok.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
         authenticate();
      }
   });  
      
      NotifyDescriptor nd = new NotifyDescriptor.Confirmation(form, "Login");
      nd.setOptions(new Object[]{ok, cancel});
      DialogDisplayer.getDefault().notifyLater(nd);
       
      nd.addPropertyChangeListener(new PropertyChangeListener(){
         public void propertyChange(PropertyChangeEvent evt){
            if(NotifyDescriptor.CLOSED_OPTION.equals(evt.getNewValue())){
               exit();
            }
         }          
      });
   }

    private void authenticate(){
      if(NbPreferences.forModule(UsermanagementPanel.class).get("user", "").equals(this.form.getUsername())){
         try {
            char[] passwordFromForm = null;
            char[] passwordFromPref = NbPreferences.forModule(UsermanagementPanel.class).get("pass", "").toCharArray();
               
            String passwordPref = new String(this.form.getPassword());
            MessageDigest MD5 = MessageDigest.getInstance("MD5");
            byte[] tmp = passwordPref.getBytes();
            MD5.update(tmp);
            passwordFromForm = byteArrToString(MD5.digest()).toCharArray();
            int correctCount = 0;
            if(passwordFromForm.length != passwordFromPref.length){
               exit();
            }
            for (int i = 0; i < passwordFromPref.length; i++) {
               if (passwordFromPref[i] == passwordFromForm[i]) {
                  correctCount++;
               }
            }
            if (passwordFromPref.length == correctCount) {
               //do nothing here
            } else {
               exit();
            }
          } catch (NoSuchAlgorithmException ex) {
             Exceptions.printStackTrace(ex);
          }
      } else {
         exit();
      }
   }
   
   private static String byteArrToString(byte[] b){
      String res = null;
      StringBuffer sb = new StringBuffer(b.length * 2);
         for (int i = 0; i < b.length; i++){
            int j = b[i] & 0xff;
            if (j < 16) {
               sb.append('0');
            }
               sb.append(Integer.toHexString(j));
            }
            res = sb.toString();
            return res.toUpperCase();
         }
   
   final private void exit(){
      LifecycleManager.getDefault().exit();
   }
}

Base on the online tutorial am following for Login form with username and password using netbeans
am having issue on the import and till unable to solve it my self here are the line am having issue with in the code

import org.yourorghere.usermanagement.UsermanagementPanel;
                                        and
private LoginForm form = new LoginForm();
please help me out i need to know how to create a login page using username and password.
thanks.

c3p | 19 Oct 22:14 2014
Picon

Restful Test Client gives blank page in all browsers

Same blank page problem for me too. Just says Test Restful Web Services at the top of the page and nothing else.

Am i missing something? i used web test client in project option but this happens all the time

Attachments: 
http://forums.netbeans.org//files/resim11_967.png

c3p | 19 Oct 22:08 2014
Picon

Testing REST web services won't work on Chrome

Same blank page problem for me too. Just says Test Restful Web Services at the top of the page and nothing else.

nzc | 19 Oct 16:39 2014
Picon

Preinstalled PHP file templates missing in New File dialog

Hi,

I recently created a new PHP file template in Netbeans with the Template Manager (Tools > Templates). Since
then the pre-installed file templates no longer appear in the "New File" dialog. I can only see my
previously created php file template. 

In the Template Manager, the pre-installed file templates are still present.

How can I restore it?

During my troubleshooting, I tried to find the location where Netbeans stores the file templates. But I
couldn't discover anything. Where are they stored?

Ethan Rosenberg | 20 Oct 02:35 2014

IDE for C

Dear List -

How do I set up Netbeans as an IDE for C?  Will it have a debugger that will enable me to step thru 
the code?

TIA

Ethan

Sorry -

Dr. Google solved it.

However....

I have installed gdb.

Debug sends me to this -

localhost/test.c?XDEBUG_SESSION_START=netbeans-xdebug

Receive a message asking me if I want to open the file with mousepad.

TIA

Ethan

Ethan Rosenberg | 19 Oct 23:29 2014

IDE for C

Dear List -

How do I set up Netbeans as an IDE for C?  Will it have a debugger that will enable me to step thru 
the code?

TIA

Ethan

common_oddity | 18 Oct 02:49 2014
Picon

Syntax Highlighting

hello all:

I just installed netbeans 8.0.1 for linux x64. I had a previously had netbeans installed, but the version
from the debian repositories. I uninstalled the debian version, and installed the version directly from netbeans.

This is my issue:

Upon opening up my source files, there is no syntax highlighting, where in my previous install there had
been. It is just plain black text. There is one piece of relevant information: I did let netbeans import
some settings they found from my old version. 

As I'm not an IDE expert, and especially not a netbeans expert, I would really appreciate some help.

Thanks!  :D

gabrielem | 17 Oct 21:18 2014
Picon

Issue with remote synchronization?

I was looking for same things, and after your post i read some others... 
At the end for me it work fine to reach my needs to disabled upload on save, and use "upload manualy"  using the
shortcut to upload file as explained here:
https://forums.netbeans.org/ntopic11326.html

I made my personal shortcut of Upload from Preferences->KeyMapon Upload.. function to look like ⌘+U
(Upload) and I discover that it save my file also.

At the end it work as you said only upload on save...
Even if it Save on Upload :)

Nimja wrote:
> Is everyone here unwilling to utter even a single word on this issue?


Gmane