0
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package progressbar;

/**
 *
 * @author DEBASISH
 */
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
public class Progressbar {
JProgressBar jprogressbar=new JProgressBar();
JButton jbutton=new JButton("Retrieve information");
public void init(){
    Container contentPane=getContentPane();
    contentPane.setLayout(new FlowLayout());
    contentPane.add(jbutton);
    jprogressbar.setForeground(Color.green);
    contentPane.add(jprogressbar);
    jbutton.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
        jProgressbar.setValue(jprogressbar.getValue()+10);}});
        jprogressbar.addChangeListener(new ChangeListener(){
            @Override
        public void stateChanged(ChangeEvent e){
            showStatus("Progressbar minimum::" +jprogressbar.getMinimum() + "maximum:"jProgressbar.getMaximum()+"value:"+jprogressbar.getValue());}

            private void showStatus(String string) {
                throw new UnsupportedOperationException("Not yet implemented");
            }
        });

}

    private Container getContentPane() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
        }    









    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    }

    private Container getContentPane() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}

when i run the program it is showing an error message "Class progressbar.Prgressbar does not have a main method"...... what does it mean ??
plz help..

Edited by Dani: Formatting fixed

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by zeroliken
1

you need to put the main method and all your methods inside your public class

private Container getContentPane() {
throw new UnsupportedOperationException("Not yet implemented");
}
}

the last bracket here ends your public class
and don't put ); after the end brackets

*next time wrap your code in code tags so we can just point out what line you got the error

Edited by zeroliken: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.