Search Results

Search found 2 results on 1 pages for 'dacto'.

Page 1/1 | 1 

  • How to combine library with my jar?

    - by Dacto
    Ok so i wrote a program that makes use of a 3rd party open source library and i want to package it with my program in a single jar. I'm using netbeans 6.8 and everything I've tried java always spit back the error: java.lang.NoClassDefFoundError: libraryname; off topic:also i would like to know how to make an executable-jar(exe) through netbeans if it is possible. (ive seen programs that were written in java but were an .exe) EDIT discovered a plugin for eclipse called FatJar which can do what i want, but i cant find something similar for netbeans, is there such thing?

    Read the article

  • Update JProgressBar from new Thread

    - by Dacto
    How can I update the JProgressBar.setValue(int) from another thread? My secondary goal is do it in the least amount of classes possible. Here is the code I have right now: **Part of the main class....** pp.addActionListener( new ActionListener(){ public void actionPerformed(ActionEvent event) { new Thread(new Task(sd.getValue())).start(); } }); public class Task implements Runnable{ int val; public Task(int value){ this.val = value; } @Override public void run() { for (int i=0; i<=value; i++){ //Progressively increment variable i pbar.setValue(i); //Set value pbar.repaint(); //Refresh graphics try{Thread.sleep(50);} //Sleep 50 milliseconds catch (InterruptedException err){} } } } pp is a JButton and starts the new thread when the JButton is clicked. pbar is the JProgressBar object from the Main class. How can I update its value?(progress) The code above in run() cannot see the pbar.

    Read the article

1