Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6137661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:45:16+00:00 2026-05-23T17:45:16+00:00

I am trying to extends the AbstractImagePrototype as below: public class DynamicImagePrototype extends AbstractImagePrototype

  • 0

I am trying to extends the AbstractImagePrototype as below:

public class DynamicImagePrototype extends AbstractImagePrototype {
private String imagePath = null;

public DynamicImagePrototype (String imagePath) {
    this.imagePath = imagePath;
}

@Override
public void applyTo(Image image) 
{

}

@Override
public Image createImage() {
    // TODO Auto-generated method stub
    Image image = new Image(imagePath);

    return image;
}

@Override
public String getHTML() {
    return null;
}

}

I used it as below:

item = new Button()
DynamicImagePrototype image = new DynamicImagePrototype(“C:/temp/icons/reporting.gif”);
item.setIcon(image);

However, it throw an exception.

My goal is that given an image file name, I want to return an AbstractImagePrototype so I can pass to Button.setIcon();

Thank you greatly for help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:45:17+00:00Added an answer on May 23, 2026 at 5:45 pm

    So far, I have not found an answer for getting the AbstractImagePrototype dynamically yet. I have to use static deferred binding as below:

    public interface ReefDesktopIconsShortcuts
    extends ImageBundle
    {
       AbstractImagePrototype anImage();
    }
    

    In the directory where this interface resides, I have an image named “anImage.gif”.

    Cheers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do this: public class DialogMenuHawaii extends Dialog { Style s
I'm trying something along these lines: private static class TexturePanel extends JPanel { @Override
Something like this is what Im trying to achieve: public Attribute<?> getAttribute(Class<? extends Attribute>
I am trying to do the following: public class character extends entity { public
I'm trying to define a custom ClassLoader. public class ExampleLoader extends ClassLoader { public
I am trying to execute the following AsyncTask : private class TimeUpdateTask extends AsyncTask<List<mObject>,
Here is what i'm trying to do <?php class My_Controller_Plugin_SomePlugin extends Zend_Controller_Plugin_Abstract { public
I was just trying to write the simple benchmark - public class IntegerCompareBenchmark extends
I am trying to do something like this final Map<String, ? extends Object> params
I am trying to extend BitmapDrawable public class CenterClampedBitmapDrawable extends BitmapDrawable I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.