954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

java

/*
* 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..

debasishdeb
Newbie Poster
1 post since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

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

zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You