Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ana Suvari
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like something which would sit better on the Swing forum. Moving.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic