• Post Reply Bookmark Topic Watch Topic
  • New Topic

in JPanel want to add an image as background and also want to use drawString()  RSS feed

 
Anu Gilotra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am facing this problem. could anyone help me out in this.
i have a JPanel in which i want to give a background Image. i also want to write some text using drawString() method of Graphics class.
i am unable to fine a way to do this.
it is very urgent.. i will be thankful.
Regards,
Anu Gilotra
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would override the paintComponent( Graphics g ) method of JPanel to look something like this :

[ December 30, 2002: Message edited by: Nathan Pruett ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!