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

  • Home
  • SEARCH
  • 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 6144025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:35:47+00:00 2026-05-23T18:35:47+00:00

I am trying to create a custom GWT Button based on an image. I

  • 0

I am trying to create a custom GWT Button based on an image.

I have an image that is not rectangular, something like this:

     Yellow Triangle Image


  1. Now, I want the click-able area to only work inside the visible parts of the image (non-transparent areas). This would mean that it’s possible for someone using the button to click in the transparent corners of the image (Button) and not trigger the click event on the Button. Is this possible without having to create a custom widget (and the HTML to go with it)?
  2. I would like to make a set of these non-rectangular buttons, in which there would be other buttons that would inter-connect with this one (their visible edges will bump right up against eachother, in sort of an inter-locking pattern), sort of like this:
    Inter-Locking Triangles

    That’s a very complex example, mine wouldn’t be as big/many but the concept holds: inter-locking buttons of custom shape each being an individual button. These buttons would not be generated statically, but grow based on action.

Is this even possible? I have no clue where to begin. The 2nd picture (pyramid inter-locking triangles) is more complex than what I’m envisioning, but the concept holds. The reason it’s more complex is because ultimately I would only be inter-locking buttons Horizontally (think of the 2nd row near the top of the pyramid picture, the 3 triangles from left to right).

  • 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-23T18:35:48+00:00Added an answer on May 23, 2026 at 6:35 pm

    You can create a simple Map Widget for <map>, <area> tags.

    public class ImageMap extends Widget implements HasMouseDownHandlers {
    
      private MapElement mapElement;
    
      public ImageMap() {
        mapElement = Document.get().createMapElement();
        setElement(mapElement);
      }
    
      public String getImgName() {
        return mapElement.getName();
      }
    
      public void setImgName(String imgName) {
        mapElement.setName(imgName);
      }
    
      public void addMapArea(AreaElement area) {
        mapElement.appendChild(area);
      }
    
      public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
        return addDomHandler(handler, MouseDownEvent.getType());
      }
    
    }
    

    The creation code:

    AreaElement area = Document.get().createAreaElement();
    area.setShape("rect");
    area.setCoords("389,250,491,502");
    area.setHref("#main");
    
    imageMap = new ImageMap();
    imageMap.setImg("frontPage");
    imageMap.addMapArea(area);
    imageMap.addMouseDownHandler(this);
    

    or can use SVG image with raphaeljs for more complex effects (see raphaelgwt). It’s better than map-area solution.

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

Sidebar

Related Questions

I'm trying to create a custom control - a button - which will have
I'm trying to create a custom UIButton that should look like a UIButtonTypeRoundedRect. In
I am trying to create custom bullet points and it is not working. This
I'm trying to create a custom class that is based off of an XML
I'm trying to create a custom helper like this: # app/controllers/my_controller.rb class MyController <
I'm trying to create custom view that draws image downloaded from Url. The code
I am trying to create custom Check Box button image. After some research, I
I'm trying to create a custom JSP tag that would take an array object
I am trying to create a custom accordion for my page to that display
I'm trying to create a custom button where the foreColor is always crimson and

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.