Friday, 9 August 2013

Get value on clicking jprogressbar

Get value on clicking jprogressbar

I am trying to make a player in java.
Have made a seekbar using jprogressbar as shown in this link in Andrew
Thompson's answer,
I have been able to add a mouselistener and detect click on jprogressbar,
but how do I get the selected value of jprogressbar to which I will seek
my bar to?
I tried,
progressBar.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
int v = progressBar.getSelectedValue();
jlabel.setText("----"+v);
}
});
But didn't work as I expected, could not even find anything on internet.
Please help me. Thanks for your time and effort, really appreciated.

No comments:

Post a Comment