• Post Reply Bookmark Topic Watch Topic
  • New Topic

ProgressBar

 
kriti sharma
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have jdk1.3.My program progressbar.java is as follows´┐Ż.

import java.awt.*;
import javax.swing.*;
class Progress extends JFrame
{
Container c;
ProgressBar pb;
JLabel label;
public Progress(int min,int max)
{
super("Forest Developement");
c=getContentPane();
c.setLayout(null);
label=new JLabel("Data transfer in progress");
pb=new ProgressBar(min,max);
label.setBounds(20,15,250,20);
c.add(label);
pb.setBounds(20,40,250,20);
c.add(pb);
pb.setOrientation(ProgressBar.HORIZONTAL_RIGHT);
pb.setDisplayLabel(true);
pb.setBarColor(new Color(0,0,128));
//pb.setValue(10);
setSize(300,150);
setVisible(true);
pb.setPostLabel("#");
}
public static void main(String str[])
{
new Progress(10,100) ;
}
}
C:\FILESORT\junk>javac progressbar.java
progressbar.java:8: cannot resolve symbol
symbol : class ProgressBar
location: class Progress
ProgressBar pb;
^
progressbar.java:16: cannot resolve symbol
symbol : class ProgressBar
location: class Progress
pb=new ProgressBar(min,max);
^
progressbar.java:21: cannot resolve symbol
symbol : variable ProgressBar
location: class Progress
pb.setOrientation(ProgressBar.HORIZONTAL_RIGHT);
^
4 errors
what to do?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error messages are telling you that the compiler doesn't see any class named "ProgressBar" -- and it's right, there's no such class in the Java API. There's a javax.swing.JProgressBar; perhaps that's what you're after.
 
kriti sharma
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i got it.
[ April 18, 2004: Message edited by: kriti sharma ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!