Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

applet image problem  RSS feed

 
Octavian Miu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello. my purpose is to add a applet into a jframe. i was able to do this for an applet that has JSWING stuff, but i m not able to display in a frame an applet that s drawing an image or any other stuff.
please help me
the applet code is very simple just paint method is overriden and only draw s something. thank you
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://download.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics.html

Possible Methods:

drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
drawImage(Image img, int x, int y, ImageObserver observer)
drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)

How hard is it?

You could also use something like on JTextPanes:


http://download.oracle.com/javase/6/docs/api/javax/swing/JTextPane.html

cc11rocks aka John Price
 
Octavian Miu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you dont understan. i want to insert a image into an applet(i ve done that) and i want to insert that applet into a jframe. if i ran the applet as standalone i was able to see the image, all worked fine, but when i added it into a jframe's container i wasnt able to seee the applet anymore. thats my big problem
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about you show us an SSCCE (click on the word if you don't know what it means) that displays the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!