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 7956429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:59:14+00:00 2026-06-04T03:59:14+00:00

In my project I need to create some play,pause,stop buttons in one composite. For

  • 0

In my project I need to create some play,pause,stop buttons in one composite.
For that I created one composite and added these buttons there. Also I have added the images
for each button. But after drawing, it does not look good. I mean images on the buttons does not look good.Clients are not satisfied. Now is it possible to add Images to Label and give some Toggle button actions to the label? I know I can add images to the label. But when I click the label,it does not give button effect..

  • 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-06-04T03:59:15+00:00Added an answer on June 4, 2026 at 3:59 am

    If you want a custom look for your ‘buttons’ you could use labels with custom images (one for the normal state and one for the “pushed” state. Something like:

    final Label stop = new Label(composite, SWT.NONE);
    stop.setSize(STOP_IMG.getImageData().width, STOP_IMG.getImageData().height)
    
    stop.setBackgroundImage(STOP_IMG);
    stop.addMouseListener(new MouseAdapter()
    {
        @Override
        public void mouseUp(MouseEvent e)
        {
            stop.setBackgroundImage(STOP_IMG);              
        }
    
        @Override
        public void mouseDown(MouseEvent e)
        {
            stop.setBackgroundImage(STOP_DOWN_IMG);
            // DO ACTION
        }           
    });
    

    For a nice UI you could also add a MouseTrack listener and have different images for the mouse over states.

    Disadvantage of this is you are making it less accessible as it will only respond to mouse events. If you go for this approach you should look at creating your own class that extends MouseAdapter, and takes the label, images and action to invoke in a constructor so you don’t end up with tonnes of very similar anonymous classes.

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

Sidebar

Related Questions

I need create some fork for project. So for some beans that depends from
I need some help with my project. I've created a Custom Adapter, since I
I'm working on a project where I need to create a link that when
I am trying to create a Project Template Wizard. For that I need a
My project requires users to create some basic math functions, I need to store
I have a project where I need to create a desktop app that acts
In a PHP project I'm working on we need to create some DAL extensions
I need to create some relationship and data flow diagrams for the project I
For a school project I need to create a program and it'd be nice
I need to create a GUID in an unmanaged windows C++ project. I'm used

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.