hi ,
i am facing a problem with jlabel.
i wanna check wether the values displayed in the label is
0 or not.but no coding seems to work.

int a=Integer.parseInt(albl.getText());
if(a==0){
lbl.setText(""+"out of stock");
}
else{
JDialog1.setVisible(true);
}

check wether the values displayed in the label is 0 or not

What is the value returned by the getText() method? Print it out so you can see if it is "0".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.