This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JProgressBar Client Server application  RSS feed

Partheban Udayakumar
Ranch Hand
Posts: 499
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am trying to implement JProgressBar in my client server application. I am reading strings from client side from a file. I don't know how many strings the file will contain. I took a look at the in oracle site and tried but I get a NPE. The codes are as follows



The Stack trace is

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at ProgressbarTest.Server.propertyChange(
at java.beans.PropertyChangeSupport.firePropertyChange(
at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(
at java.beans.PropertyChangeSupport.firePropertyChange(
at javax.swing.SwingWorker.firePropertyChange(
at javax.swing.SwingWorker$
at javax.swing.SwingWorker$
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(
at javax.swing.Timer.fireActionPerformed(
at javax.swing.Timer$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$200(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

NPE occurs at

in propertyChange() function.

I don't want to transfer the file here. I just want the strings. What am I doing wrong here?

Update: Since I create a new object of Server to add as property change in task.addPropertyChangeListener(new Server());, the NPE occurs now it is solved. But the problem now is it run only once and updates the progress bar to that level. How to show the update for each and every string it receives?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!