Meaningless Drivel is fun!
The moose likes Java in General and the fly likes Cannot access JScrollPane, bad class file !!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Cannot access JScrollPane, bad class file !!!!" Watch "Cannot access JScrollPane, bad class file !!!!" New topic

Cannot access JScrollPane, bad class file !!!!

Ho Dab

Joined: Feb 16, 2005
Posts: 2
Hi everybody. I have got a big big problem. I can not compile my code because this message alwayes is displayed:

C:\Java\hosseindab\ cannot access JScrollPane
bad class file: .\JScrollPane.class
class file contains wrong class: javax.swing.JScrollPane
Please remove or make sure it appears in the correct subdirectory of the classpath.
private JScrollPane skrollytan;

I tried to uninstall and reinstall SDK och Textpad, but it didn't work. I even installed them on another computer, but it was the same problem. I do not know what has happened. I have tried j2SDK 1_3_1_15 and j2sdk 1_4_0_01. No use. I could compile the same files some hours ago, but now the Textpad says NO, NO, NO!!! and generates the above error. Just please help me, I don't have much time to deliver my java program.
The code is:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Dabb extends JFrame implements ActionListener
private JLabel lBild1,lBild2,lBild3;
private JScrollPane skrollytan;
private JPanel panelen;
private JRadioButton knapp1, knapp2, knapp3;
private JSplitPane delning;
private ButtonGroup gruppen;

public Dabb()
lBild1 = new JLabel(new ImageIcon("Solnedg�ng.jpg"));
lBild2 = new JLabel(new ImageIcon("Vinter.jpg"));
lBild3 = new JLabel(new ImageIcon("Bl�a kullar.jpg"));

skrollytan = new JScrollPane();
panelen = new JPanel();

gruppen = new ButtonGroup();
knapp1 = new JRadioButton("Solnedg�ng",true);
knapp2 = new JRadioButton("Vinter",false);
knapp3 = new JRadioButton("Bl�a kullar",false);

delning = new JSplitPane();

Container c = getContentPane();
delning.setMinimumSize(new Dimension(300,300));

panelen.setLayout(new BoxLayout(panelen,




setSize(600, 400);
public void actionPerformed(ActionEvent e)
Object o = e.getSource();

if(o == knapp1)

else if(o == knapp2)

else if(o == knapp3)

public static void main(String [] argv)
Dabb v = new Dabb();

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Please don't post the same question in multiple forums. Just pick the one where you think your question is closest to the topic at hand. If you pick wrong, we can direct you to the most appropriate forum. Cross-posting just wastes our time because the answer may have already been given somewhere else.


Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: Cannot access JScrollPane, bad class file !!!!
It's not a secret anymore!