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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:15:10+00:00 2026-06-07T00:15:10+00:00

I created a JButton which has an image set as an icon representing the

  • 0

I created a JButton which has an image set as an icon representing the button. Now, I’ve set

setContentAreaFilled(false);
setBorderPainted(false);
setOpaque(false);

the properties which this makes an image-button look nice with no borders or background colors etc.

Now the problem is that when I click on the image, it shows no onclick effects of a button, so when there is some background processing involved or some event is bring fired on click of button which takes time to process the request and return something, it gives an impression that the button was not clicked and the user might keep clicking it.

How do I make a button which has an icon set with the above mentioned properties and yet I have some control over setting the onpress or onmouseover events.

  • 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-07T00:15:11+00:00Added an answer on June 7, 2026 at 12:15 am

    I found the answer: setRolloverIcon() and setPressedIcon() will do the magic.

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

Sidebar

Related Questions

In Java Swing I would like to create a JButton which contains an image(icon)
I've trouble with actionListener. I created own simple dialog, which has only two JButtons
I want to add a button (JButton) at the bottom of a JDialog which
I have created a simple Java application which has a JFrame and few JButtons.
I have created a swing application as bellow which shows main tasks in tabs
I have created in my Java Swing application a main window with a JButton.
I've created a frame (mainframe) for my program in the main class which I
I have created a class which extends JDialog, where I have some checkboxes and
I have created a JFrame and a put a textfield and the button.in the
i am trying to make an actionListener on a button in another button which

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.