JProgressBar - NetBeans

I just started working with NetBeans IDE and making GUI's, and have a question about the jProgressBar: When I use a Thread.Sleep(int) to delay for a time, it will do something like this:
for(int j = 0; j<=100;j++)
Thread.sleep(300);                //this makes it wait for 30000 miliseconds
jProgressBar1.setValue(j);       //then does all of the setValue()'s at once
}I want it to wait for 300 miliseconds, then set the value one more then it was, etc. so it fills up gradually. How do I do this?

Something like this:import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
public class TimedProgressBar  implements ActionListener {
   JProgressBar progressBar = new JProgressBar (0, 100);
   Timer timer = new Timer (300, this);
   void makeUI () {
      JFrame frame = new JFrame ("");
      frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
      frame.setSize (300, 50);
      frame.add (progressBar);
      frame.setLocationRelativeTo (null);
      frame.setVisible (true);
      timer.start ();
   public void actionPerformed (ActionEvent e) {
      int i = progressBar.getValue ();
      if (i == progressBar.getMaximum ()) {
         timer.stop ();
      progressBar.setValue (progressBar.getValue () + 1);
   public static void main (String[] args) {
      SwingUtilities.invokeLater (new Runnable () {
         public void run () {
            new TimedProgressBar ().makeUI ();
Darryl is right, as usual.Nah, I've contributed my share of bloopers to the forum :-).
But do you know why Thread.sleep(300) doesn't have the desired effect?
Are you interested?Lets hope...
How's the weekend going, Keith?
Darryl
edit Removed one remark after scrolling right and reading the oh-sso-spaced-out comments in the OP.
Edited by: Darryl.Burke

Similar Messages

  • How do I thead a netbeans/ java aplication?

    How would i multithread this?
    i creadted a gui in netbeans to run my antivirus for mac, its coded in version 6 of java, (windows and linux), how would i thread it to output finds and after it scans every 100 files scanned?
    The full files are avalable at www.saveourmacs.com
    * JavaAntivirusView.java
    package saveourmacs;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.text.DecimalFormat;
    import org.jdesktop.application.Action;
    import org.jdesktop.application.ResourceMap;
    import org.jdesktop.application.SingleFrameApplication;
    import org.jdesktop.application.FrameView;
    import org.jdesktop.application.TaskMonitor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Timer;
    import javax.swing.Icon;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    * The application's main frame.
    public class JavaAntivirusView extends FrameView {
        public Signatures sig;
        public boolean virusFound;
        public int count = 1;
        public long before, after, total = 0;
        public DecimalFormat cur;
        public JavaAntivirusView(SingleFrameApplication app) {
            super(app);
            initComponents();
            sig = new Signatures("C:\\Documents and Settings\\Ryan\\Desktop\\MAIN\\main.db", this.textoutput);
            // status bar initialization - message timeout, idle icon and busy animation, etc
            ResourceMap resourceMap = getResourceMap();
            int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
            messageTimer = new Timer(messageTimeout, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    statusMessageLabel.setText("");
            messageTimer.setRepeats(false);
            int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
            for (int i = 0; i < busyIcons.length; i++) {
                busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
            busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                    statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
            statusAnimationLabel.setIcon(idleIcon);
            progressBar.setVisible(false);
            // connecting action tasks to status bar via TaskMonitor
            TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
            taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
                public void propertyChange(java.beans.PropertyChangeEvent evt) {
                    String propertyName = evt.getPropertyName();
                    if ("started".equals(propertyName)) {
                        if (!busyIconTimer.isRunning()) {
                            statusAnimationLabel.setIcon(busyIcons[0]);
                            busyIconIndex = 0;
                            busyIconTimer.start();
                        progressBar.setVisible(true);
                        progressBar.setIndeterminate(true);
                    } else if ("done".equals(propertyName)) {
                        busyIconTimer.stop();
                        statusAnimationLabel.setIcon(idleIcon);
                        progressBar.setVisible(false);
                        progressBar.setValue(0);
                    } else if ("message".equals(propertyName)) {
                        String text = (String)(evt.getNewValue());
                        statusMessageLabel.setText((text == null) ? "" : text);
                        messageTimer.restart();
                    } else if ("progress".equals(propertyName)) {
                        int value = (Integer)(evt.getNewValue());
                        progressBar.setVisible(true);
                        progressBar.setIndeterminate(false);
                        progressBar.setValue(value);
        @Action
        public void showAboutBox() {
            if (aboutBox == null) {
                JFrame mainFrame = JavaAntivirusApp.getApplication().getMainFrame();
                aboutBox = new JavaAntivirusAboutBox(mainFrame);
                aboutBox.setLocationRelativeTo(mainFrame);
            JavaAntivirusApp.getApplication().show(aboutBox);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
        private void initComponents() {
            mainPanel = new javax.swing.JPanel();
            jScrollPane1 = new javax.swing.JScrollPane();
            textoutput = new javax.swing.JTextArea();
            SelectDirectory = new javax.swing.JButton();
            UpdateDefinitions = new javax.swing.JButton();
            Scan = new javax.swing.JButton();
            Exit = new javax.swing.JButton();
            dirselect = new javax.swing.JTextField();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            menuBar = new javax.swing.JMenuBar();
            javax.swing.JMenu fileMenu = new javax.swing.JMenu();
            javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
            javax.swing.JMenu helpMenu = new javax.swing.JMenu();
            javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
            statusPanel = new javax.swing.JPanel();
            javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
            statusMessageLabel = new javax.swing.JLabel();
            statusAnimationLabel = new javax.swing.JLabel();
            progressBar = new javax.swing.JProgressBar();
            mainPanel.setName("mainPanel"); // NOI18N
            jScrollPane1.setName("jScrollPane1"); // NOI18N
            textoutput.setColumns(20);
            textoutput.setRows(5);
            textoutput.setName("textoutput"); // NOI18N
            textoutput.addComponentListener(new java.awt.event.ComponentAdapter() {
                public void componentShown(java.awt.event.ComponentEvent evt) {
                    textoutputComponentShown(evt);
            jScrollPane1.setViewportView(textoutput);
            org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(saveourmacs.JavaAntivirusApp.class).getContext().getResourceMap(JavaAntivirusView.class);
            SelectDirectory.setText(resourceMap.getString("SelectDirectory.text")); // NOI18N
            SelectDirectory.setName("SelectDirectory"); // NOI18N
            SelectDirectory.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mousePressed(java.awt.event.MouseEvent evt) {
                    SelectDirectoryMousePressed(evt);
            UpdateDefinitions.setText(resourceMap.getString("UpdateDefinitions.text")); // NOI18N
            UpdateDefinitions.setName("UpdateDefinitions"); // NOI18N
            UpdateDefinitions.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mousePressed(java.awt.event.MouseEvent evt) {
                    UpdateDefinitionsMousePressed(evt);
            Scan.setText(resourceMap.getString("Scan.text")); // NOI18N
            Scan.setName("Scan"); // NOI18N
            Scan.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mousePressed(java.awt.event.MouseEvent evt) {
                    ScanMousePressed(evt);
            Exit.setText(resourceMap.getString("Exit.text")); // NOI18N
            Exit.setName("Exit"); // NOI18N
            Exit.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mousePressed(java.awt.event.MouseEvent evt) {
                    ExitMousePressed(evt);
            dirselect.setText(resourceMap.getString("dirselect.text")); // NOI18N
            dirselect.setName("dirselect"); // NOI18N
            jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
            jLabel1.setName("jLabel1"); // NOI18N
            jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
            jLabel2.setName("jLabel2"); // NOI18N
            javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
            mainPanel.setLayout(mainPanelLayout);
            mainPanelLayout.setHorizontalGroup(
                mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(mainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addComponent(SelectDirectory)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(UpdateDefinitions)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(Scan)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(Exit))
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(dirselect, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel2)))
                    .addContainerGap())
            mainPanelLayout.setVerticalGroup(
                mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(dirselect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(SelectDirectory)
                        .addComponent(UpdateDefinitions)
                        .addComponent(Scan)
                        .addComponent(Exit))
                    .addContainerGap())
            menuBar.setName("menuBar"); // NOI18N
            fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
            fileMenu.setName("fileMenu"); // NOI18N
            javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(saveourmacs.JavaAntivirusApp.class).getContext().getActionMap(JavaAntivirusView.class, this);
            exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
            exitMenuItem.setName("exitMenuItem"); // NOI18N
            fileMenu.add(exitMenuItem);
            menuBar.add(fileMenu);
            helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
            helpMenu.setName("helpMenu"); // NOI18N
            aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
            aboutMenuItem.setName("aboutMenuItem"); // NOI18N
            helpMenu.add(aboutMenuItem);
            menuBar.add(helpMenu);
            statusPanel.setName("statusPanel"); // NOI18N
            statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
            statusMessageLabel.setName("statusMessageLabel"); // NOI18N
            statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
            statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
            progressBar.setName("progressBar"); // NOI18N
            javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
            statusPanel.setLayout(statusPanelLayout);
            statusPanelLayout.setHorizontalGroup(
                statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(statusMessageLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 231, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(statusAnimationLabel)
                    .addContainerGap())
            statusPanelLayout.setVerticalGroup(
                statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(statusPanelLayout.createSequentialGroup()
                    .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(statusMessageLabel)
                        .addComponent(statusAnimationLabel)
                        .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(3, 3, 3))
            setComponent(mainPanel);
            setMenuBar(menuBar);
            setStatusBar(statusPanel);
        }// </editor-fold>//GEN-END:initComponents
    private void ExitMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ExitMousePressed
    // TODO add your handling code here:
    System.exit(0);//GEN-LAST:event_ExitMousePressed
    private void SelectDirectoryMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SelectDirectoryMousePressed
    // TODO add your handling code here:
      /*  textoutput.setText(" Initializing...");
        String filename = File.separator+"tmp";
        JFileChooser fc = new JFileChooser(new File(filename));
        // Show open dialog; this method does not return until the dialog is closed
        fc.showOpenDialog(frame);
        File selFile = fc.getSelectedFile();
        // Show save dialog; this method does not return until the dialog is closed
        fc.showSaveDialog(frame);
        selFile = fc.getSelectedFile();
        /*if (aboutBox == null) {
                JFrame mainFrame = JavaAntivirusApp.getApplication().getMainFrame();
                aboutBox = new JavaAntivirusAboutBox(mainFrame);
                aboutBox.setLocationRelativeTo(mainFrame);
            JavaAntivirusApp.getApplication().show(aboutBox); */
        if (aboutBox == null) {
                JFrame mainFrame = JavaAntivirusApp.getApplication().getMainFrame();
                aboutBox = new JavaAntivirusAboutBox(mainFrame);
                aboutBox.setLocationRelativeTo(mainFrame);
            JavaAntivirusApp.getApplication().show(aboutBox);
    }//GEN-LAST:event_SelectDirectoryMousePressed
    private void UpdateDefinitionsMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_UpdateDefinitionsMousePressed
    // TODO add your handling code here:
    /*FTPClient ftpClient = new FTPClient();
    ftpClient.connect("ftp.foo.com", "user01", "pass1234");
    ftpClient.download("C:\\Temp\\", "README.txt");
    // Eventually other operations here ...
    ftpClient.disconnect();*/
    }//GEN-LAST:event_UpdateDefinitionsMousePressed
    private void ScanMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ScanMousePressed
    // TODO add your handling code here:
        String directorychoose "";
        directorychoose = dirselect.getText();
        if(directroychoose.equals(""))
          directorychoose = "."; 
        cur =  new DecimalFormat(".00");
        File startingDirectory = new File(directorychoose);
        //File startingDirectory = new File(".");
        textoutput.append("Scanning Files.");
        scanDirectory(startingDirectory);
    }//GEN-LAST:event_ScanMousePressed
    private void textoutputComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_textoutputComponentShown
      // TODO add your handling code here:
    }//GEN-LAST:event_textoutputComponentShown
    * This program demonstrates how to traverse a directory.
    * @version 1.0
    * @author  Jeffrey M. Hunter  ([email protected])
    * @author  http://www.idevelopment.info
        public void scanDirectory(File dir) {
              if (count % 100 == 0)
                   if ( (total / 1000) < 60 )
                        textoutput.append(count + " files scanned in " + cur.format((double)(total) / 1000) + " seconds.");
                   else
                        textoutput.append(count + " files scanned in " + cur.format((double)(total) / 60000) + " minutes." );               
            if (dir.isDirectory()) {
                String[] children = dir.list();
                for (int i=0; i<children.length; i++) {
                        scanFile(dir.getAbsolutePath() + "\\" +children);
    scanDirectory(new File(dir, children[i]));
         public void scanFile(String fileName)
              before = System.currentTimeMillis();
              File f = new File(fileName);
              virusFound = false;
              count++;
              if ((int)f.length() > Integer.MAX_VALUE) {
                   textoutput.append("Not enough memory to read file.");
                   System.exit(-1);
              //System.out.print ("Scanning " + f + " - ");
              byte[] bytes = new byte[(int)f.length()]; // assume < 2gb
              RandomAccessFile raf = null;
              try
                   raf = new RandomAccessFile(f,"r");
                   raf.readFully(bytes);
                   raf.close();
              catch (Exception e)
                   textoutput.setText(e.toString());
                   //System.exit(-1);
              String fileBytes = new String(bytes);
              for (int i = 0; i < sig.numSigs(); i++)
                   if (fileBytes.indexOf(sig.getSignature(i).getPattern()) > 0 )
                        textoutput.append(sig.getSignature(i).getName() + " Virus Found!");
              after = System.currentTimeMillis();
              total = total + (after - before);
              if (!virusFound)
                   System.out.println("Clean");
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Exit;
    private javax.swing.JButton Scan;
    private javax.swing.JButton SelectDirectory;
    private javax.swing.JButton UpdateDefinitions;
    private javax.swing.JTextField dirselect;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JTextArea textoutput;
    // End of variables declaration//GEN-END:variables
    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;
    private JDialog aboutBox;
    public static void download(String address) {
              int lastSlashIndex = address.lastIndexOf('/');
              if (lastSlashIndex >= 0 &&
              lastSlashIndex < address.length() - 1) {
                   //download(address, address.substring(lastSlashIndex + 1));
              } else {
                   System.err.println("Could not figure out local file name for " +
                        address);
    public static void download(String address, String localFileName) {
              OutputStream out = null;
              URLConnection conn = null;
              InputStream in = null;
              try {
                   URL url = new URL(address);
                   out = new BufferedOutputStream(
                        new FileOutputStream(localFileName));
                   conn = url.openConnection();
                   in = conn.getInputStream();
                   byte[] buffer = new byte[1024];
                   int numRead;
                   long numWritten = 0;
                   while ((numRead = in.read(buffer)) != -1) {
                        out.write(buffer, 0, numRead);
                        numWritten += numRead;
                   System.out.println(localFileName + "\t" + numWritten);
              } catch (Exception exception) {
                   exception.printStackTrace();
              } finally {
                   try {
                        if (in != null) {
                             in.close();
                        if (out != null) {
                             out.close();
                   } catch (IOException ioe) {
    public static void main(String[] args) {
              for (int i = 0; i < args.length; i++) {
                   download(args[i]);
    Edited by: kingryanj on Jun 19, 2008 10:49 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    nclow wrote:
    Dumping a huge application in the lap of a stranger and asking them to tell you how to multithread it is a pretty tall order, don't you think? You might try familiarizing yourself with threading concepts here , identifying the parts of your program that you want to split into new threads, and then come back if you have some specific questions.not to mention it sounds like threading is not what the OP even wants
    a simple counter would suffice and every time the counter reaches 100 you could print or whatever and then reset the counter

  • Assistance in programming a splash screen with a JProgressbar?

    I want to implement a Splash screen with a JProgress Bar showing that its loading. Anyone can provide any hints and ideas on how to do it.
    I manage to do a splash screen with just a simple image and using timer to control it but now i want to add in the progress bar. And now i'm stuck. had a look through the JProgressBar and it looks hard.
    cheers

    >
    I felt my question was specific enough. >Live and (hopefully) learn.
    >
    ..Surely software developers have heard of splash screen and know what it is. It is a start up screen that pops up before any application starts.>JWS can provide the same basic 'download with progress' functionality as a 'start up splash' might do, for functionalities that are not even supplied before the app. is on-screen, which is why I was asking for clarification about whether you meant 'before start-up' or ..something else.
    BTW - did you actually notice the two methods I pointed to, that provide splash/loading progress for an application start-up?
    >
    Ever used Eclipse IDE or Netbeans? If you have you would of know what i meaning. >Sure I've seen them. It was some time ago though, and all I recall was a splash image, no progress bar.
    Had you ever deployed application resources lazily? Seen an app. that does a long running process such as DB interrogation or report generation with a progress dialog? There are many purposes that might fit the general description of providing something for the user to look at, during a long-running process.
    The world is not as small as you seem to think.
    >
    What my questions is how do you code that splash screen, combining a progress bar onto the splash.>Well CB gave you the 'google' for the term, and you seemed to think that was helpful, so see how you go with it..

  • How to use Ejb with Hibernate in netbeans

    hello everybody
    i am developing a project using ejb and hibernate as a persistance provider. i need some idea how to develop a web application in netbeans. I went through a example in netbeans but it's not helping me.If any body can give me some idea
    many thanks
    sri

    Well, I've never used a JProgressBar before, so I'm
    not sure. If I add it to the frame, can I call it
    whenever I need to use it like when I click the
    JMenuItem do I just call it?Questions like these are better answered by the tutorials:
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

  • Serious problems on GUI with NetBeans.....

    package supershare;
    import java.awt.event.*;
    import javax.swing.*;
    public class testGUI extends javax.swing.JFrame implements java.awt.event.ActionListener{
        public testGUI(){initComponents();}
    public void initComponents(){/*Generated Code*/}
    public static void main(String args[]) {
                    new testGUI().setVisible(true);
      public void actionPerformed(ActionEvent e)
            /*JProgressBar jp = new JProgressBar(0, 100);
            jp.setValue(0);
            jp.setStringPainted(true);
            this.add(jp);
            this.validate();*/
            this.remove(jButton1);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        // End of variables declaration
    }Above is the code I made under NetBeans....
    As you know, NetBeans has a function called "JFrameForm", which allows you to design GUI more conviniently....
    if you are familar with NetBeans, you can easily understand the above code...
    You know what I am trying to do is that when I click the button, the button should disappear, but it doesnot....
    please help here... actually, I have a bigger project meeting this problem.. and if I have to design the whole project without using NetBeans's JFrameForm function, it will be a nightmare...yes, lots of work...
    Apreciate any help
    thanks

    Has any one here used NetBeans before???
    It has nothing to do with netbeans (except the layout manager you used happens to come with it)
    You need to understand what you are doing in terms of LayoutManagers and Containers. You cannot just add a Component to a Container with anything but the simplest layout manager - you need to understand the constraints the manager uses. In this case, I designed my JFrame using the Netbeans designer (which is most cool I must say) and added a JPanel to act as an area to add and remove components from (so I don't have to understand the GroupLayout constraints).
    Be forewarned that GroupLayout is not (as of yet) part of the standard jdk and you may have issues trying to distribute your application or run it outside of netbeans unless you know what you are doing or netbeans does it for you (I haven't tried yet)
    Good luck
    import java.awt.BorderLayout;
    import javax.swing.JProgressBar;
    * @author  Ian Schneider
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            jPanel1 = new javax.swing.JPanel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("Press Me");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jPanel1.setLayout(new java.awt.BorderLayout());
            jPanel1.setName("progressArea");
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jButton1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
                    .addContainerGap())
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
                    .addContainerGap()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            pack();
        // </editor-fold>
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            final JProgressBar jpb = new JProgressBar(0,100);
            jPanel1.add(jpb,BorderLayout.CENTER);
            jPanel1.validate();
            jPanel1.repaint();
            Runnable task = new Runnable() {
                public void run() {
                    jButton1.setEnabled(false);
                    for (int i = 0; i < 100; i++) {
                        jpb.setValue(i);
                        try {
                            Thread.sleep(50);
                        } catch (InterruptedException ie) {}
                    jButton1.setEnabled(true);
                    jPanel1.remove(jpb);
                    jPanel1.validate();
                    jPanel1.repaint();
            new Thread(task).start();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration
    }

  • Refresh jProgressBar

    Hi,
    Problem seems to be popular in forums, but i did't find solution in my situation. I have main class which creates thread for second class with JFrame frame.
    public class mainClass
         public static void main(String[] args)
              dialogClass dialogFrame = new dialogClass(null,false);
                 Thread newThread_1 = new Thread(dialogFrame);
                 newThread_1.start();
    }Here is code for second class called from mainClass:
    public class dialogClass extends javax.swing.JDialog implements Runnable, ActionListener
         progressFrame progress; //object of progressFrame
         Thread myThread_2;     //Thread which will be run to update progressBar
         public dialogClass(java.awt.Frame parent, boolean modal)
                 super(parent, modal);
                 initComponents();
                 jButton1.addActionListener(this); //This is for testing purposes
              /**Create object of class which shows JProgressBar.
              * Class progressFrame implements Runnable interface.
                 progress = new progressFrame(null,false);
                 myThread_2 = new Thread(progress);
         // I am working in NetBeans that's why this method
         private void initComponents()
              jButton1 = new JButton("run");
         public void actionPerformed(ActionEvent evt)
                    myThread2.start();
              /* Here is my problem.
              * When user click button, progressBar should be updated in loop
              int i = 0
              //I have made a few tries to resolve my problem
              //1st
              while(i <=10)
                  /** this method is implemented in class with progressBar.
                  * It uses setValue to set value of progressBar
                        progress.updateProgressBar(i);
                        try
                            Thread.sleep(1000);
                        } catch (InterruptedException ex)
                            ex.printStackTrace();
                        i++;
                    System.out.println("Finished");
              //2nd try
              // In this example is use SwingUtilities.invokeLater to update progressBar but it also doesn't work.
              while(i <=10)
                        SwingUtilities.invokeLater(new Runnable()
                            public void run()
                                progress.updateProgressBar(10);
                        try
                            Thread.sleep(1000);
                        } catch (InterruptedException ex)
                            ex.printStackTrace();
                        i++;
    }Somebody knows why this code doesn't work when I put it inside actionPerformed method and (the same code) work great directly inside run() method. Does somebody know how to update progressBar
    inside actionPerformed method. I can't use it inside run() method.
    Peter D.

    I really apreciate for your answer. Method updateProgressBar is responsible for updating (setValue()) progressBar in other thread.
    Thanks for link, but I didn't find situation like mine (updating values inside other thread) in any documentation.
    Thank you again
    Peter D.
    Code correction.
    myThread = new Thread(new Runnable()
                public void run()
                    progress = new progressFrame(null,false,10);
                    Thread myThread2 = new Thread(progress);
                    myThread2.start();
                    System.out.println("actionPerformed currentThread: " + myThread.currentThread().getName());
                    int i = 0;
                    while(i <=10)
                        progress.updateProgressBar(i);
                        try
                            Thread.sleep(1000);
                        } catch (InterruptedException ex)
                            ex.printStackTrace();
                        i++;
                    System.out.println("finished");
            myThread.start();Message was edited by:
    Peter_D

  • Application working under NetBeans but not as a *.jar file

    Hello,
    recently I found a little problem. I wrote application that shows all available ports in my computer. When I am running this applications under NetBeans it works with no problem - finds all available ports. Then I am building it to the *.jar file. Application is working with no problem but command:
    Enumeration PortIds = CommPortIdentifier.getPortIdentifiers();
    is not returning any identifiers - PortIds is empty.
    Anyone knows a solution for this type of problems? Thanks

    Hi Venkatesh,
    Few questions.
    1. What is your JDeveloper version? (Always better to post your JDev version along with the question, which would help us to help you better).
    2. Did you try adding webserviceclient.jar to the classpath? (Search in your JDev installation directory for the location of this jar file).
    -Arun

  • .jar file is not working properly :developed in NETBEANS

    Hi Gurus,
    i am using NETBEANS IDE 7.2.
    i am developing a project that interacts with databases 10g and COM ports of machine , these all processes are performed by .bat file which i am trying to run from jFramform , code works perfectly .bat file is also called perfectly when i run the project using F6 from the NETBEANS, for testing i placed some dialogue boxes on the form to test it ,
    but when i run executable .jar  file , form run successfully and dialogue box works perfectly but .bat file is not called by executable .jar file.
    this is how i call the .bat file...
      String filePath = "D:/pms/Libraries/portlib.bat";  
            try { 
              Process p = Runtime.getRuntime().exec(filePath); 
            } catch (Exception e) { 
                e.printStackTrace(); 
    and below is the contents of portlib.bat file
    java -jar "D:\SMS\SMS\dist\SMS.jar" 
    you must probably ask why i am calling a .jar file using .bat file .
    reason is that this .jar project sends message using GSM mobile , System.exit(); is compulsory to complete a job and then do the next one ,
    if i use the same file to execute this job it makes exit to entire the application (hope you can understand my logic).
    that's why i use extra .jar file in .bat file , when single job is completed .bat exits itself and new command is given.
    Problem is that code is working perfectly in NETBEANS when i run the project but when i run .jar then .bat file is not working  ,
    thanks.

    Thanks Sir ,
    You need to first test an example that works like the one in the article.
    There are plenty of other examples on the web - find one you like:
    http://javapapers.com/core-java/os-processes-using-java-processbuilder/
    I tried this one.
      try {
                ProcessBuilder dirProcess = new ProcessBuilder("D:/SMS/SMS/Send_message.bat");
                 File commands = new File("D:/SMS/SMS/Send_message.bat");
                 File dirOut = new File("C:/process/out.txt");
                 File dirErr = new File("C:/process/err.txt");
               dirProcess.redirectInput(commands);
                 dirProcess.redirectOutput(dirOut);
               dirProcess.redirectError(dirErr);
                 dirProcess.start();
            } catch (IOException ex) {
                Logger.getLogger(mainform.class.getName()).log(Level.SEVERE, null, ex);
    as instructed in the article i compiled  both the projects at same version or sources and libraries which is 1.7
    here is my version details
    C:\>javac -version
    javac 1.7.0_07
    C:\>java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
    Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
    inside the NETBEANS IDE c:\process\err.txt  remains empty and code works perfectly , but when I run executable .jar file( by double clicking on that file in dist directry) then c:\process\err.txt becomes full with this error text and there is no response from calling D:\SMS\SMS\send_message.bat
    here is the error text
    java.lang.UnsupportedClassVersionError: sms/SMSMAIN (Unsupported major.minor version 51.0)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Exception in thread "main"
    here is /SMS/SMS
    unknown source ?

  • NetBeans MobilityPack 5 BUG?? how can I send a byte array?

    I�ve created a WebApp and a Simple servlet with one public method.
    public byte[] getStr(byte[] b) {       
    String s = "A string";
    return s.getBytes();
    Then I've used "Mobile To Web App" wizard to generate stubs to that getStr method. And when I�ve tried to call that getStr method:
    byte[] aByte = "st".getBytes();
    byte[] b = client.getStr(aByte);
    I've got an error at Server in Utility.java in generated ReadArray method.
    * Reads an array from the given data source and returns it.
    *@param source The source from which the data is extracted.
    *@return The array from the data source
    *@exception IOException If an error occured while reading the data.
    public static Object readArray(DataInput in) throws IOException {
    short type = in.readShort();
    int length = in.readInt();
    if (length == -1) {
    return null;
    } else {
    switch (type) {
    case BYTE_TYPE: {
    byte[] data = new byte[length];
    in.readFully(data);
    return data;
    default: {
    throw new IllegalArgumentException("Unsupported return type (" + type + ")");
    At this line "in.readFully(data);" I�ve got an EOFException.
    The the aByte = "st".getBytes(); was 2bytes long and at the server "int length = in.readInt();" it was 363273. Why?
    All code was generated by NetBeans Mobility pack 5 it's not mine so its a bug?
    How can I fix this?

    I found that bug. I've described it here
    http://www.netbeans.org/issues/show_bug.cgi?id=74109
    There's a solution how to fix the generated code.

  • Error while creating a blackberry application in netbeans

    hi everyone,
    i am trying to create a blackberry application along with my midlet in netbeans 6.5, where as the build failed with errors.
    here are the errors i am getting.. can anyone help me........
    java.io.IOException: CreateProcess: "D:\Research In Motion\bin\preverify" -classpath "D:\Research In Motion\BlackBerry JDE 4.6.0\lib\net_rim_api.jar" -d D:\ProjectHome\MoBilal-English\build\preverified
    D:\ProjectHome\MoBilal-English\build\preverifysrc error=3
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:828)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:445)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:459)
    at org.netbeans.mobility.antext.PreverifyTask.execute(PreverifyTask.java:225)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:481)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
    BUILD FAILED (total time: 9 seconds)
    thanks in advance
    pallavi

    hi everyone,
    i am trying to create a blackberry application along with my midlet in netbeans 6.5, where as the build failed with errors.
    here are the errors i am getting.. can anyone help me........
    java.io.IOException: CreateProcess: "D:\Research In Motion\bin\preverify" -classpath "D:\Research In Motion\BlackBerry JDE 4.6.0\lib\net_rim_api.jar" -d D:\ProjectHome\MoBilal-English\build\preverified
    D:\ProjectHome\MoBilal-English\build\preverifysrc error=3
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:828)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:445)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:459)
    at org.netbeans.mobility.antext.PreverifyTask.execute(PreverifyTask.java:225)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:481)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
    BUILD FAILED (total time: 9 seconds)
    thanks in advance
    pallavi

  • Error while building a Webservice in Netbeans EJB Module

    I have copied the java code of a JCD doing xml to cobol copybook transformation in JCAPS, to a new webservice created in the Netbeans EJB module. There were no compilation errors. But while trying to build, I am getting errors like "java.io.printStream does not have a no-arg default Constructor" , "IllegalAnnotation Exception", "Unable to create jaxb context" etc..
    I am not able to find out why this happened... Someone please help me in resolving this issue......

    Guys,
    I am able to solve the problem. I think the problem is Language settings difference between Database and OWB repository.

  • Netbeans 5.0 crashes... please help..

    Hi, i just installed netbeans 5.0 with the latest java package. When i first execute the program, it crashes. Below is the error log. Can anyone help me? This is not the first time. I already uninstall and reinstall java and reinstalling netbeans. This same outcome.
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00d18280, pid=3352, tid=3872
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
    # Problematic frame:
    # J java.awt.GradientPaintContext.clipFillRaster([IIIIIDDD)V
    --------------- T H R E A D ---------------
    Current thread (0x030081e0): JavaThread "AWT-EventQueue-1" [_thread_in_Java, id=3872]
    siginfo: ExceptionCode=0xc0000005, reading address 0xffffffff
    Registers:
    EAX=0x1cadd928, EBX=0x00000000, ECX=0x1cb53c80, EDX=0x00000000
    ESP=0x0365e4f8, EBP=0x0365e528, ESI=0x00000000, EDI=0x00000020
    EIP=0x00d18280, EFLAGS=0x00010246
    Top of Stack: (sp=0x0365e4f8)
    0x0365e4f8: 00000000 00000000 00000000 00000000
    0x0365e508: 00ad29fa 00000001 1cadd934 00000000
    0x0365e518: 00000000 ffffffff 1c71c71c 3fbc71c7
    0x0365e528: 0365e588 00d8e3eb 1c71c71c 3fac71c7
    0x0365e538: 00000000 00000000 1c71c71c 3fbc71c7
    0x0365e548: 00000000 00000020 00000000 00000000
    0x0365e558: 1cadd928 1cb53c80 0365e5ac 00000000
    0x0365e568: 00000000 1cadd928 00000000 00000000
    Instructions: (pc=0x00d18280)
    0x00d18270: dd 45 18 dd 5d f8 8b 7d 24 dd 45 f8 d9 ee d9 c9
    0x00d18280: df e9 dd c0 d9 f7 0f 8a 06 00 00 00 0f 86 0e 00
    Stack: [0x03620000,0x03660000), sp=0x0365e4f8, free space=249k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    J java.awt.GradientPaintContext.clipFillRaster([IIIIIDDD)V
    J java.awt.GradientPaintContext.getRaster(IIII)Ljava/awt/image/Raster;
    J sun.java2d.pipe.AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V
    j sun.java2d.pipe.SpanShapeRenderer$Composite.renderBox(Ljava/lang/Object;IIII)V+15
    j sun.java2d.pipe.SpanShapeRenderer.spanClipLoop(Ljava/lang/Object;Lsun/java2d/pipe/SpanIterator;Lsun/java2d/pipe/Region;[I)V+56
    j sun.java2d.pipe.SpanShapeRenderer.renderSpans(Lsun/java2d/SunGraphics2D;Lsun/java2d/pipe/Region;Ljava/awt/Shape;Lsun/java2d/pipe/ShapeSpanIterator;)V+131
    j sun.java2d.pipe.SpanShapeRenderer.renderPath(Lsun/java2d/SunGraphics2D;Ljava/awt/Shape;)V+43
    j sun.java2d.pipe.SpanShapeRenderer.fill(Lsun/java2d/SunGraphics2D;Ljava/awt/Shape;)V+33
    j sun.java2d.pipe.PixelToShapeConverter.fillPolygon(Lsun/java2d/SunGraphics2D;[I[II)V+14
    j sun.java2d.pipe.ValidatePipe.fillPolygon(Lsun/java2d/SunGraphics2D;[I[II)V+17
    j sun.java2d.SunGraphics2D.fillPolygon([I[II)V+8
    j java.awt.Graphics.fillPolygon(Ljava/awt/Polygon;)V+13
    j org.netbeans.swing.tabcontrol.plaf.WinXPEditorTabCellRenderer.paintGradient(Ljava/awt/Graphics;Lorg/netbeans/swing/tabcontrol/plaf/WinXPEditorTabCellRenderer;Lorg/netbeans/swing/tabcontrol/plaf/TabPainter;)V+39
    j org.netbeans.swing.tabcontrol.plaf.WinXPEditorTabCellRenderer.access$700(Ljava/awt/Graphics;Lorg/netbeans/swing/tabcontrol/plaf/WinXPEditorTabCellRenderer;Lorg/netbeans/swing/tabcontrol/plaf/TabPainter;)V+3
    j org.netbeans.swing.tabcontrol.plaf.WinXPEditorTabCellRenderer$WinXPPainter.paintInterior(Ljava/awt/Graphics;Ljava/awt/Component;)V+8
    j org.netbeans.swing.tabcontrol.plaf.AbstractTabCellRenderer.paintComponent(Ljava/awt/Graphics;)V+27
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+260
    j org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI.paint(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V+404
    j javax.swing.plaf.ComponentUI.update(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V+32
    j javax.swing.JComponent.paintComponent(Ljava/awt/Graphics;)V+26
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+260
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    j org.netbeans.core.windows.view.ui.MultiSplitPane.paint(Ljava/awt/Graphics;)V+2
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73
    J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V
    j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+292
    j javax.swing.JComponent.paintWithOffscreenBuffer(Ljavax/swing/JComponent;Ljava/awt/Graphics;IIIILjava/awt/Image;)V+174
    j javax.swing.JComponent.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/Component;Ljava/awt/Graphics;IIII)Z+131
    J javax.swing.JComponent._paintImmediately(IIII)V
    j javax.swing.JComponent.paintImmediately(IIII)V+83
    j javax.swing.RepaintManager.paintDirtyRegions()V+314
    j javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()V+32
    j java.awt.event.InvocationEvent.dispatch()V+47
    j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26
    J java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z
    v ~RuntimeStub::alignment_frame_return Runtime1 stub
    j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26
    j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
    j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
    j java.awt.EventDispatchThread.run()V+9
    v ~StubRoutines::call_stub
    V [jvm.dll+0x845a9]
    V [jvm.dll+0xd9317]
    V [jvm.dll+0x8447a]
    V [jvm.dll+0x841d7]
    V [jvm.dll+0x9ed69]
    V [jvm.dll+0x109fe3]
    V [jvm.dll+0x109fb1]
    C [MSVCRT.dll+0x2a3b0]
    C [kernel32.dll+0xb50b]
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x02d1d188 JavaThread "Image Fetcher 1" daemon [_thread_blocked, id=216]
    0x02d00d90 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=3472]
    0x0302df18 JavaThread "Inactive RequestProcessor thread [Was:Parsing Event Queue/org.netbeans.modules.javacore.JMManager$5]" daemon [_thread_blocked, id=3532]
    0x032ac270 JavaThread "Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.modules.editor.errorstripe.AnnotationView$RepaintTask]" daemon [_thread_blocked, id=2444]
    0x032d7dd0 JavaThread "Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.modules.navigator.NavigatorController$ActNodeSetter]" daemon [_thread_blocked, id=2364]
    0x02f42500 JavaThread "Inactive RequestProcessor thread [Was:ToolTip-Evaluator/org.netbeans.modules.editor.NbToolTip$Request]" daemon [_thread_blocked, id=1060]
    0x02ced900 JavaThread "Inactive RequestProcessor thread [Was:Overriddens Queue/org.netbeans.modules.java.OverrideAnnotationSupport$Request]" daemon [_thread_blocked, id=3868]
    0x02e1d7d0 JavaThread "MDR event dispatcher" daemon [_thread_blocked, id=3996]
    0x00037b60 JavaThread "DestroyJavaVM" [_thread_blocked, id=900]
    =>0x030081e0 JavaThread "AWT-EventQueue-1" [_thread_in_Java, id=3872]
    0x031ebb28 JavaThread "TimerQueue" daemon [_thread_blocked, id=2448]
    0x031d2b80 JavaThread "Inactive RequestProcessor thread [Was:ListModelSupport loader/org.netbeans.modules.java.navigation.spi.ListModelSupport$Loader]" daemon [_thread_blocked, id=1836]
    0x031a6dd8 JavaThread "Inactive RequestProcessor thread [Was:Java Node State Updater/org.netbeans.modules.java.JavaNode$StateUpdater]" daemon [_thread_blocked, id=1788]
    0x0316cb90 JavaThread "Inactive RequestProcessor thread [Was:ToolTip-Evaluator/org.netbeans.modules.editor.NbToolTip$Request]" daemon [_thread_blocked, id=3228]
    0x02f3d390 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3456]
    0x00acf638 JavaThread "AWT-Windows" daemon [_thread_in_native, id=628]
    0x02ecd948 JavaThread "AWT-Shutdown" [_thread_blocked, id=2720]
    0x00acd950 JavaThread "Timer-0" daemon [_thread_blocked, id=1852]
    0x02cd8820 JavaThread "CLI Requests Server" daemon [_thread_in_native, id=1340]
    0x00ab7a70 JavaThread "Active Reference Queue Daemon" daemon [_thread_blocked, id=2492]
    0x00a70268 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3004]
    0x00a6eed8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3440]
    0x00a6e1c0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3444]
    0x0003fa20 JavaThread "Finalizer" daemon [_thread_blocked, id=3492]
    0x00a48aa0 JavaThread "Reference Handler" daemon [_thread_blocked, id=2580]
    Other Threads:
    0x00a68428 VMThread [id=3628]
    0x00a714b8 WatcherThread [id=3752]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 2304K, used 914K [0x1ca70000, 0x1ccf0000, 0x1d440000)
    eden space 2048K, 44% used [0x1ca70000, 0x1cb54868, 0x1cc70000)
    from space 256K, 0% used [0x1cc70000, 0x1cc70000, 0x1ccb0000)
    to space 256K, 0% used [0x1ccb0000, 0x1ccb0000, 0x1ccf0000)
    tenured generation total 30272K, used 16957K [0x1d440000, 0x1f1d0000, 0x24a70000)
    the space 30272K, 56% used [0x1d440000, 0x1e4cf758, 0x1e4cf800, 0x1f1d0000)
    compacting perm gen total 32768K, used 21094K [0x24a70000, 0x26a70000, 0x2aa70000)
    the space 32768K, 64% used [0x24a70000, 0x25f098f0, 0x25f09a00, 0x26a70000)
    ro space 8192K, 66% used [0x2aa70000, 0x2afcbcc0, 0x2afcbe00, 0x2b270000)
    rw space 12288K, 46% used [0x2b270000, 0x2b812060, 0x2b812200, 0x2be70000)
    Dynamic libraries:
    0x00400000 - 0x0040c000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\java.exe
    0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
    0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
    0x6d6e0000 - 0x6d874000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\client\jvm.dll
    0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f56000 C:\WINDOWS\system32\GDI32.dll
    0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
    0x6d2f0000 - 0x6d2f8000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
    0x6d6b0000 - 0x6d6bc000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\verify.dll
    0x6d370000 - 0x6d38d000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\java.dll
    0x6d6d0000 - 0x6d6df000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\zip.dll
    0x6d530000 - 0x6d543000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\net.dll
    0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
    0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
    0x76d60000 - 0x76d79000 C:\WINDOWS\system32\iphlpapi.dll
    0x76d40000 - 0x76d58000 C:\WINDOWS\system32\MPRAPI.dll
    0x77cc0000 - 0x77cf2000 C:\WINDOWS\system32\ACTIVEDS.dll
    0x76e10000 - 0x76e35000 C:\WINDOWS\system32\adsldpc.dll
    0x5b860000 - 0x5b8b4000 C:\WINDOWS\system32\NETAPI32.dll
    0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
    0x76b20000 - 0x76b31000 C:\WINDOWS\system32\ATL.DLL
    0x774e0000 - 0x7761c000 C:\WINDOWS\system32\ole32.dll
    0x77120000 - 0x771ac000 C:\WINDOWS\system32\OLEAUT32.dll
    0x76e80000 - 0x76e8e000 C:\WINDOWS\system32\rtutils.dll
    0x71bf0000 - 0x71c03000 C:\WINDOWS\system32\SAMLIB.dll
    0x77920000 - 0x77a13000 C:\WINDOWS\system32\SETUPAPI.dll
    0x71a50000 - 0x71a8f000 C:\WINDOWS\system32\mswsock.dll
    0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
    0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
    0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
    0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
    0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll
    0x0ffd0000 - 0x0fff8000 C:\WINDOWS\system32\rsaenh.dll
    0x769c0000 - 0x76a73000 C:\WINDOWS\system32\USERENV.dll
    0x6d070000 - 0x6d1d7000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\awt.dll
    0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
    0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.dll
    0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll
    0x73760000 - 0x737a9000 C:\WINDOWS\system32\ddraw.dll
    0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll
    0x73940000 - 0x73a10000 C:\WINDOWS\system32\D3DIM700.DLL
    0x10000000 - 0x10005000 C:\WINDOWS\BricoPacks\Vista Inspirat\ObjectDock\DockShellHook.dll
    0x74720000 - 0x7476b000 C:\WINDOWS\system32\MSCTF.dll
    0x03510000 - 0x0351f000 C:\WINDOWS\BricoPacks\Vista Inspirat\YzToolbar\YzToolBar.dll
    0x5d090000 - 0x5d127000 C:\WINDOWS\system32\COMCTL32.dll
    0x7c9c0000 - 0x7e77e000 C:\WINDOWS\system32\shell32.dll
    0x77f60000 - 0x77ff7000 C:\WINDOWS\system32\SHLWAPI.dll
    0x773d0000 - 0x774d2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x6d2b0000 - 0x6d2ed000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\fontmanager.dll
    0x6d550000 - 0x6d559000 C:\Program Files\Java\jdk1.5.0_06\jre\bin\nio.dll
    0x605d0000 - 0x605d9000 C:\WINDOWS\system32\mslbui.dll
    0x71b20000 - 0x71b32000 C:\WINDOWS\system32\MPR.dll
    0x75f60000 - 0x75f67000 C:\WINDOWS\System32\drprov.dll
    0x71c10000 - 0x71c1e000 C:\WINDOWS\System32\ntlanman.dll
    0x71cd0000 - 0x71ce7000 C:\WINDOWS\System32\NETUI0.dll
    0x71c90000 - 0x71cd0000 C:\WINDOWS\System32\NETUI1.dll
    0x71c80000 - 0x71c87000 C:\WINDOWS\System32\NETRAP.dll
    0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll
    0x77b40000 - 0x77b62000 C:\WINDOWS\system32\appHelp.dll
    0x76fd0000 - 0x7704f000 C:\WINDOWS\system32\CLBCATQ.DLL
    0x77050000 - 0x77115000 C:\WINDOWS\system32\COMRes.dll
    0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll
    0x76980000 - 0x76988000 C:\WINDOWS\system32\LINKINFO.dll
    0x03bc0000 - 0x03c09000 C:\WINDOWS\system32\ntshrui.dll
    VM Arguments:
    jvm_args: -Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -Xms32m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=96m -Xverify:none -Dapple.laf.useScreenMenuBar=true -Dnetbeans.osenv=C:\DOCUME~1\M996F~1.KHA\LOCALS~1\Temp\nbenv3 -Dnetbeans.osenv.nullsep=true -Djdk.home=C:\Program Files\Java\jdk1.5.0_06 -Dnetbeans.home=C:\Program Files\netbeans-5.0\platform6 -Dnetbeans.dirs=C:\Program Files\netbeans-5.0\nb5.0;C:\Program Files\netbeans-5.0\ide6;C:\Program Files\netbeans-5.0\enterprise2;C:\Program Files\netbeans-5.0\harness -Dnetbeans.user=C:\Documents and Settings\M.Khalid\.netbeans\5.0 -Dnetbeans.system_http_proxy=DIRECT -Dsun.awt.keepWorkingSetOnMinimize=true
    java_command: org/netbeans/Main --branding nb
    Launcher Type: SUN_STANDARD
    Environment Variables:
    CLASSPATH=.
    PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\QuickTime\QTSystem\ ; C:\Program Files\Java\jre1.5.0_06\bin
    USERNAME=M.Khalid
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 6, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 1 family 6, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 514544k(100160k free), swap 1258580k(883052k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_06-b05) for windows-x86, built on Nov 10 2005 11:12:14 by "java_re" with MS VC++ 6.0

    Did you try asking Netbeans support too?

  • How to deploy web app from PC to Linux with Netbeans ?

    I am developing a web app in Netbeans 6.0 on my PC, using the Tomcat comes with the IDE, now I need to deploy it to a Linux server running Tomcat, can I do it from inside the IDE ? Can it copy all the servlets and other java classes to the Linux for me ? If so, what info does it need from me ? Login, password ... ?
    If not, how can I do it by hand ?
    Frank

    RTFM
    You need to consult the NetBeans Help to see if it will export a WAR/EAR. Regarding getting it over to Linux, there are some issues there. But if you have visibility to the Linux deploy directory from your PC then it's possible. It's certainly possible to do ALL of this using Apache Ant.

  • Compile / run problems with netbeans 6 but not netbeans 6 beta 1 or 5.5

    When I compile my project in netbeans IDE 6.0 (Build 200711261600) 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 i get quite often a "can not find symbol" error or during runtime a "netbeans 6 java.lang.NoClassDefFoundError" exception. also switching between F6 or ctrl-F5 mode can cause the problem to appear.
    Compiling again or clean build resolves it.
    However running the same project under netbeans 5.5 or 6 beta 1 never gives this problem.
    any hint what might be wrong? i looked and compared the project settings but can't see any difference, but I assume that the upgrade script must have changed something.

    <?xml version="1.0" encoding="UTF-8" ?>
    - <project name="BorderDemo" default="default" basedir=".">
    <import file="nbproject/build-impl.xml" />
    </project>This is 'build.xml' file. Check for 'project.xml' file in 'nbproject' folder. You will find it to be:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <project xmlns="http://www.netbeans.org/ns/project/1">
      <type>org.netbeans.modules.java.j2seproject</type>
    - <configuration>
    - <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
      <name>BorderDemo</name>
      <minimum-ant-version>1.6.5</minimum-ant-version>
    - <source-roots>
      <root id="src.dir" />
      </source-roots>
      </data>
      </configuration>
      </project>Change it to:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <project xmlns="http://www.netbeans.org/ns/project/1">
      <type>org.netbeans.modules.java.j2seproject</type>
    - <configuration>
    - <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
      <name>BorderDemo</name>
      <minimum-ant-version>1.6.5</minimum-ant-version>
    - <source-roots>
      <root id="src.dir" />
      </source-roots>
      <test-roots>
      <root id="test.src.dir" />
      </test-roots>
      </data>
      </configuration>
      </project>I hope it works.....
    thanks!

  • Running a NetBeans 5.5.1 GUI in Java 1.5?

    Hi everyone, thanks for your interest.
    I've created a GUI in NetBeans 5.5.1 using the Group Layout package, which is included in Java 1.6.
    The only problem is I need this app to run in a Java 1.5 environment.
    I'm not an expert at this but after extensive searching it looks like I can import a .jar file to make everything work again?
    The problem is I add this swing-layout-1.0.jar to my class path but in the source file for my application it refers to these classes by javax.swing.________ and not by the org.whatever that the .jar I took uses. Futhermore, there seem to exist some differences between the classes in the javax.swing and my .jar file.
    Is there ANY way for me to make all this java 1.6 code to run in java 1.5. Perhaps by including some extra package?
    If so, where would I find such a package?
    If you don't think this can be done please let me know so I can stop bashing my head against the wall.
    Thanks,
    Craig

    From this URL
    http://java.sun.com/developer/technicalArticles/tools/nb_guibuilder/
    The Free Design layout has been available since NetBeans IDE 5.0. NetBeans IDE 5.0's GUI Builder provided support for this layout strategy by using a separate library called the Swing Layout Extensions. The IDE provided that library because the support for the underlying GroupLayout layout manager was not yet part of the core Java platform in J2SE 5.0. The Swing Layout Extensions are still available, but now that functionality also exists in the core libraries of the Java SE 6 platform.
    You can use NetBeans IDE 5.5 to develop applications and UIs for Java SE 6 or earlier Java platform versions. If you write applications for any platform version prior to Java SE 6, you must continue to use the Swing Layout Extensions. However, the new GUI builder can also generate your UI using the layout manager functionality supported in the Java SE 6 platform. In the latter case, you do not need to use or include the layout extensions in your final product.
    If you create a new project in NetBeans IDE 5.5 and your target platform is Java SE 6, the GUI builder will automatically generate your UI using the Java SE 6 platform's core libraries. However, if you import an old project into NetBeans IDE 5.5, you should manually update the project's layout to use the new Java SE 6 platform libraries. Of course, you can still use the layout extensions if you like, but doing so is not necessary with the Java SE 6 platform.
    You can change the Layout Generation Style for your UI by accessing the properties for your form. In the NetBeans IDE GUI Builder main window, make sure the Design mode is active. This shows your UI design graphically in the Design pane. Click on the form in the Inspector pane to see the form's properties. One of the properties is Layout Generation Style. You can select either Standard Java 6 Code or Swing Layout Extensions Library. Changing this setting does not affect how your UI will look, but it does change how the GUI builder generates the code to create the UI. Figure 16 shows the Layout Generation Style property.

Maybe you are looking for

  • I have a Mac Mini and it crashes every few hours

    A description of the problem, he writes me : Mon Jan 26 05:24:22 2015 *** Panic Report *** panic(cpu 4 caller 0xffffff8024a1e80a): Kernel trap at 0xffffff80249759b7, type 14=page fault, registers: CR0: 0x000000008001003b, CR2: 0x0000000000000ff0, CR3

  • 1080p videos sluggish on Macbook Pro

    Hi, If I run a slideshow in iPhoto 9 containing an 1080p MP4 video it is all sluggish and running at very low framerate consuming all CPU power. Running the same video using a double click (will open Quicktime) makes it run absolutely smooth. Is ther

  • IMac won't boot up. Stuck in "verbose mode" ??

    I've had this problem on and off for a few weeks now. I either restart my iMac after installing some new software-or for other reason- and my computer won't boot up. Sometimes it will stay at the white screen with the grey apple for hours if I leave

  • Why is my outlook account on iOS mail not logging in?

    I have an outlook account that was logged in and used to work on the mail app on my iPhone 4s. Then it stopped receiving mail so I logged the account out and logged back in and a message keeps on popping up saying that it is unable to verify the acco

  • VMware error on Qosmio x500-110 and Win 7 64bit

    I am having problems running Vmware player on this notebook. It allways gives this error: Operation on file "D:\VM\WinXP - VS 2008 - Blanco\XPSP3VMwTEMP-s003.vmdk" failed. If the file resides on a remote file system, please make sure your network con