This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

ProgressBar

 
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?
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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!