File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Applet Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Applet Error" Watch "Applet Error" New topic

Applet Error

Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 481
Hi Friends,
I am new to Java.I am trying to understand Applet's JColorChooser from the below program.But the program is showing error that i couldn't figure out.Please help me.


EDIT by mw: Added Code Tags to original poster's indentation.
[ January 05, 2006: Message edited by: marc weber ]
marc weber

Joined: Aug 31, 2004
Posts: 11343

Originally posted by SP Mohan:
...the program is showing error that i couldn't figure out.Please help me...

Hi SP,

Welcome to JavaRanch!

First, note that I added Code Tags to your post. This keeps your formatting intact. Also, you will probably want to include your import statements with your code to make it easier for others to test...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

And it helps if you post the error message you're getting.

Now, my guess is you're having a problem with this line:
JDialog d=theChooser.createDialog(JApplet.this, ...

I believe you want:
JDialog d=theChooser.createDialog(ColorDialog2.this, ...

(Also see Sun's tutorial on using JColorChooser.)

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: Applet Error
It's not a secret anymore!