It's not a secret anymore!*
The moose likes Swing / AWT / SWT and the fly likes set the background panel to an jpeg and display text in front of it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "set the background panel to an jpeg and display text in front of it" Watch "set the background panel to an jpeg and display text in front of it" New topic
Author

set the background panel to an jpeg and display text in front of it

Ana Suvari
Ranch Hand

Joined: Aug 18, 2009
Posts: 43
I'm trying to set the background to a jpeg but i want to have a little text panel on top of it at the bottom that describes the image.

Can some explain to me what i am missing? I am just not understanding. A point to a direction would be appreciated.
I get the following error messages when i compile:
cannot find symbol method add(java.awt.Image) .... line 29
cannot find symbol method paintComponent(java.awt.Graphics) .... line 36
method does not override or implement a method from a supertype .... line 33


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
what a mixed bag that lot is.

might not be what you want, but these changes will get it to compile and run as an application

//extends JApplet
extends JPanel

//Container contentPane = getContentPane(); remove it

//contentPane.add(image);//remove it

//contentPane.add(messagePane);
add(messagePane);

and you would need to add, perhaps in init()
message();
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38492
    
  23
Sounds like something which would sit better on the Swing forum. Moving.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Applet inside a JFrame???!!!


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: set the background panel to an jpeg and display text in front of it