File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Cannot find symbol error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Cannot find symbol error" Watch "Cannot find symbol error" New topic

Cannot find symbol error

Pooja Oza

Joined: Apr 01, 2009
Posts: 21
Can someone please help me with this code? I cannot run this program. I am getting the error - "Cannot find symbol
symbol : method setOpaque(boolean)
method : class Login
newContentPane.setOpaque(true); "


Pooja Oza
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

setOpaque is a method of JComponent, and although JFrame is part of Swing it does not (directly or indirectly) extend JComponent. Therefore, JFrame has no such method. Since you're wrapping the Login instance in a new JFrame you might as well make Login extend JPanel instead.

How To Ask Questions How To Answer Questions
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Cannot find symbol error
Similar Threads
Reg: Running Swing in Browser
Single Application but Multiple Connection problem
How to activate threads in Swings.
Single Application but Multiple Connection problem
Single Application but Multiple Connection problem