• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like something which would sit better on the Swing forum. Moving.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Applet inside a JFrame???!!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic