• 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Create New Image Using 1.1

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello! Could anybody tell how I could create a new blank image and assign current dimensions using only Java 1.1 API? What I'm basically trying to do is:
BufferedImage img = new BufferedImage(width, height,....);
only with just an image, in that API 1.1 doesn't support BufferedImage.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at Component.createImage(int width, int height).
The Component's peer must already have been created for this call to work, so don't use it in the classes constructor.
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to force components peer creation,
I am getting null on createImage
I have an applet which has an panel. Inside panel class within paint method i am trying to create an image(width, height) it returns null.
I put the same code inside addnotify method it doesnt work either,
This panel is constructor inside applet init method.
Please help

Farouk
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for your code I appreciate. The problem I have is that I dont want the Image to appear in the applet but rather in a separate panel inside the applet.

So say if the size of the applet is 600 * 600 the panel inside should residein the center of the applet and contain the image. This is where I have problem as you have detailed I am able to create an image inside an applet without any panel in it.
The panel which will contain the image will be cleaned and corrected using mouse actions and i like the background color of the applet to be different from the panel.
Hope you understand my main issue is how to embed an image inside an panel which will reside inside a applet

Thanks appreciate your help
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for your code I appreciate. The problem I have is that I dont want the Image to appear in the applet but rather in a separate panel inside the applet.

So say if the size of the applet is 600 * 600 the panel inside should residein the center of the applet and contain the image. This is where I have problem as you have detailed I am able to create an image inside an applet without any panel in it.
The panel which will contain the image will be cleaned and corrected using mouse actions and i like the background color of the applet to be different from the panel.
Hope you understand my main issue is how to embed an image inside an panel which will reside inside a applet

Thanks appreciate your help
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi sorry when i run the code you sent me it does show only a pink box nothing else. Please can you check
Thanks
Farouk
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The problem I have is that I dont want the Image to appear in the applet but rather in a separate panel inside the applet.



Ummm, does the InnerPanel class which is used to display the image not qualify as a Panel?
 
Lookout! Runaway whale! Hide behind this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic